Skip

And for this, I am no longer nothing, I am more
February 7, 2013 12:52 PM   Subscribe


 
Aha, someone else has discovered Monster Zero Ultra. It's like discovering Mountain Dew or Jolt Cola all over again, and yet it's sugar free. I think I'll start writing a book, after I look up parts for my bike on the internet, and I think I'll run my snowblower to make sure it still works and let's comment this code.
posted by Slap*Happy at 1:01 PM on February 7, 2013 [2 favorites]


The author uses "it's" when they mean "its", which grates upon my very soul.
posted by jcreigh at 1:01 PM on February 7, 2013 [7 favorites]


Aha, someone else has discovered Monster Zero Ultra. It's like discovering Mountain Dew or Jolt Cola all over again, and yet it's sugar free.

Huh? Googling tells me that's an energy drink?
posted by eustacescrubb at 1:03 PM on February 7, 2013


It's full of apostraphes!
posted by Going To Maine at 1:05 PM on February 7, 2013 [1 favorite]


Does it?
posted by boo_radley at 1:05 PM on February 7, 2013 [1 favorite]


Just turning every 'do' into 'doth' is not really how Elizabethan English works.
posted by shakespeherian at 1:08 PM on February 7, 2013 [5 favorites]


Also, originally Elizabethan English speakers did not write JavaScript, or speak thus of ThyTube.
posted by weston at 1:12 PM on February 7, 2013 [15 favorites]


Aha, someone else has discovered Monster Zero Ultra. It's like discovering Mountain Dew or Jolt Cola all over again, and yet it's sugar free.

I assume that means it has some kind of magnificently carcinogenic sweetener in vast quantities instead? Thanks, but I'll take sugar - or even corn-based pseudosugar - over aspertame any day of the week.
posted by Tomorrowful at 1:12 PM on February 7, 2013


"Thy" means "your", not "its" or "a" or "the" or any of the other things it's being used for here.

It's got some funny bits, but if you're going to do King James Javascript you really have to be accurate.
posted by echo target at 1:13 PM on February 7, 2013 [7 favorites]


Better than most, says what he is trying to accomplish instead of just restating the code in English as if it will be read by non-programmers who need a translator for var i = 0.
posted by Ad hominem at 1:13 PM on February 7, 2013 [4 favorites]


Man, forget the comment language. The brittle nature of that parsing code in trackYouTube() makes me want to run away screaming.
posted by Brak at 1:19 PM on February 7, 2013 [3 favorites]


Ad hominem: EXACTLY. For all of you non-programmers out there, part of what makes these comments awesome is not just the (bad) Elizabethan English and the Star Wars references, but that the programmer has written comments that describe, for a layperson, what the code is doing (like this:
//And for this, I am no longer nothing, I am more
i++;
).

That allows him to make jokes and have fun with the comments, and even make political commentary. (like this:
//Harken to the iframes of the page
//thy loathesome demon gallavanting upon
//our innocent sweet html
).

Also, if someone wants to explain the energy drink joke in the first comment that'd be awesome because I totally don't get it.
posted by eustacescrubb at 1:21 PM on February 7, 2013 [2 favorites]


Just turning every 'do' into 'doth' is not really how Elizabethan English works.

Yeah, but the idea of a "doth/whilst" loop is kick-ass.

Also
//it tries to trick us with a number one greater than
//that of our arrays. But we outsmart it.
//with math.


With math. Love it.
posted by benito.strauss at 1:21 PM on February 7, 2013 [4 favorites]


Also, if someone wants to explain the energy drink joke in the first comment that'd be awesome because I totally don't get it.

Whoever wrote this was wired.
posted by figurant at 1:22 PM on February 7, 2013 [1 favorite]


Also, originally Elizabethan English speakers did not write JavaScript, or speak thus of ThyTube.

Isn't that ThouTube, weston?
posted by wenestvedt at 1:23 PM on February 7, 2013 [1 favorite]


The brittle nature of that parsing code in trackYouTube() makes me want to run away screaming.

No kidding! I know, I know, regular expressions and now I have two problems, but maybe spend less time dothifying your comments and more time writing non-crap code?
posted by axiom at 1:24 PM on February 7, 2013 [1 favorite]


I think the energy drink thing is saying that this is the sort of stunt you pull when you're hopped up on caffeine (or other stimulants) found in energy drinks. Just my guess.
posted by benito.strauss at 1:24 PM on February 7, 2013


Also, if someone wants to explain the energy drink joke in the first comment that'd be awesome because I totally don't get it.

I think it simply suggests the coder has had a burst of excess energy that makes doing something completely fun and completely unnecessary like this while working seem like a great idea. Coders stereotypically get their energy boosts from caffeine drinks.
posted by distorte at 1:25 PM on February 7, 2013 [1 favorite]


The brittle nature of that parsing code in trackYouTube()

Yeah, I'd have used a regex for that, then no need for the second conditional just for https. But also, no chance to make the armor joke. So who'm I to criticize?
posted by eustacescrubb at 1:26 PM on February 7, 2013 [2 favorites]


Coders stereotypically get their energy boosts from caffeine drinks.

Yeah, I think that's why I didn't get the joke. I've only been writing code for 15 years, and I've only work with dozens of "coders" (we usually call ourselves developers or engineers) and the only guy I've ever known to guzzle energy drinks (or even, really drink a lot of them, or, actually any at all) is a QA analyst. But you know, my experience is probably limited.
posted by eustacescrubb at 1:28 PM on February 7, 2013 [3 favorites]


Could be optimized a little.
posted by Artw at 1:30 PM on February 7, 2013 [2 favorites]


I think coders are like those kids that hang out on IRC and work on a totally fucking awesome MMO with Kevin from home room who can draw amazing anime and it will be so much better than world of borecraft. So maybe they do drink energy drinks. I drink whatever is free and already made, mostly coffee.
posted by Ad hominem at 1:34 PM on February 7, 2013 [1 favorite]


Now I feel kind of bad, criticizing the code. Every developer has written sub-optimal code, and every developer will do so again, including me. I should know better.
posted by Brak at 1:35 PM on February 7, 2013


I'm afraid The Social Network has set the template for software developers for the next twenty years. We all drink energy drinks now and then go into extended coding trances from which it is dangerous to prematurely wake us.

I write code too. I'm guessing everyone who opened this post writes code.
posted by distorte at 1:37 PM on February 7, 2013 [5 favorites]


Wouldst thou waste thy merriest code on a villainous ThouTube iframe hack or set thyself on the most expedient path?
posted by rocketpup at 1:47 PM on February 7, 2013 [1 favorite]


What I like most about this is that - while nobody on the outside world would ever know - there *is* something internally epic about coding. Just as words on the page fire up the imagination, an application becomes a kind of landscape in the mind, this vast and giant machine with different cogs and levers acting upon each other, and soon they start to take on characters, even personalities: The reliable parts, the quirky parts, the parts that betray you at every opportunity, the parts that are like your children and the parts that are like your nemeses. I never got to the point where I was writing fan-fic about my own code, but, perhaps, unconsciously, everybody does.
posted by bicyclefish at 1:50 PM on February 7, 2013 [14 favorites]


//Forsooth here doth we instantiate thy youtube player api

^
Syntax error: 1st person plural "we" doth not agree with 3rd person singular "doth"
posted by mr vino at 1:51 PM on February 7, 2013 [1 favorite]


I was impressed by this

//Harken to the iframes of the page

Because it's a blank-verse line with a trochaic first foot, similar to "Now is the winter of our discontent."

But I guess that was an accident. The rest is prose.
posted by grumblebee at 2:26 PM on February 7, 2013 [2 favorites]


The brittle nature of that parsing code in trackYouTube() makes me want to run away screaming.

I do find it odd that it handles one very specific case of URL args (rel=0) but not any of the other args one could put after a YouTube embed link. Then again the context in which this code will be used is not clear.

(And unlike the API, URL formats and args are subject to change without warning)

That said, it's better documented than the actual YouTube API code itself, so there's that.
posted by wildcrdj at 2:26 PM on February 7, 2013 [1 favorite]


("to-morrow" && "to-morrow" && "to-morrow").each {
   this.creeps("slow", { 
    now() .. time((2^32) -1 );
   }
}
for ( var i = now(); i <= this.yesterdays(); i++) {
    var j = fools.light();
    delete j;
}
if (candle.length < NORMAL_CANDLE_LENGTH) {
   candle.out();
}
if (navigator.mimeTypes ["application/x-shockwave-flash"] != undefined) {
    swfobject.embedSWF("oneHourPlay.swf");
}
var tale = MichaelBay.playback();
assert (tale === nothing);

posted by jenkinsEar at 2:27 PM on February 7, 2013 [17 favorites]


Strip out the comments and it makes a pretty decent 'how would you improve this code' interview question.

-Developer is concerned enough with the global namespace to protect the $ sign in a self-executing function (though it is used inconsistently within there, sometimes 'jQuery' is used within the fxn), but not enough to avoid polluting it needlessly with stuff like 'tag' and 'videoArray'. Everything in the global namespace should be wrapped into a single object to minimize your namespace footprint.
-Just declare array literals, 'new Array()' is a waste of keystrokes.
-var video = $(this), and then video is used, wait for it....once.
-inconsistent variable declaration. Sometimes it's youtubeid, sometimes it's vidSrc
-Assign vidSrc to an empty string is a total waste, just declare and assign in the same line.
-The big "if event.data == SOME_YOUTUBE_CONSTANT" is a classic switch statement use case
-Even if you don't want to use a switch, since the third parameter in the _gaq call is the only variable, use a variable for that and you won't have to repeat the code five times.
-The duplicate code to handle the https case is quite bad. You don't even need a regex, just map the http case to one offset and https to another. The no-op else seems to have been included just for the sake of additional commentary.
posted by Kwine at 2:32 PM on February 7, 2013 [5 favorites]


Because it's a blank-verse line with a trochaic first foot, similar to "Now is the winter of our discontent."

Not quite. It's either an iambic-pentameter line with the unstressed syllable removed from the first foot, or it's a trochaic-pentameter line with the unstressed syllable removed from the fifth foot.

Iambic pentameter with a trochaic first foot would read: "Harken to th'iframes I have coded here!"

Trochaic pentameter would read: "Harken to the iframes I have coded."
posted by Rustic Etruscan at 2:53 PM on February 7, 2013 [1 favorite]


It's a pretty useful script, to boot.
posted by Vhanudux at 2:57 PM on February 7, 2013 [1 favorite]


The duplicate code to handle the https case is quite bad. You don't even need a regex, just map the http case to one offset and https to another.

"THIS IS WHAT FUCKING FUNCTIONS ARE FOR" was my thought. The minute you hit Ctrl-P (or ⌘-P or whatever) you have lost the programming game; insert another quarter.

there *is* something internally epic about coding.

Don't assume your internal worldview is universal. For me its more like taking an aggressive poop or maintaining an addiction: a struggle that feels so good when its done.
posted by Ogre Lawless at 3:33 PM on February 7, 2013


idk I'm a secretary (read: neither a developer nor a liberal arts major) and I thought it was funny as hell. also I've done a brief whack at understanding Javascript and this was a hell of a lot more illuminating than "hello world" or whatever.
posted by lonefrontranger at 3:53 PM on February 7, 2013 [1 favorite]


Isn't that ThouTube, weston?

Verily, forsooth, I hath no idea.
posted by weston at 4:00 PM on February 7, 2013


The minute you hit Ctrl-P (or ⌘-P or whatever) you have lost the programming game; insert another quarter.

I agree, but as part of my "process" I sometimes ctrl-c/ctrl-v quite a lot to get stuff functional then abstract.

Of course, there is no way I could do something simple like a function. Along with my YouTubeIdProvider I will need a IIdProvider and an IdProviderFactory to abstract the instantiation of my IIdProvider, don't want to have to ctrl-f for my ctor and change it all over the place if I want to switch from youtube to blip. I also need a MockIdProvider, to generate a bogus id useful for testing.

With enough layers of abstraction and encapsulation I can be prepared for any change in the requirements.

We we are looking at 20 hours to add video site integration and write the test suite.
posted by Ad hominem at 4:15 PM on February 7, 2013 [1 favorite]


I thought I'd be cruel and run it through JSLint, but it's chokimg at 8% with trivial stuff before giving me anything useful. JSLint is a harsh mistress.
posted by Artw at 4:20 PM on February 7, 2013


With enough layers of abstraction and encapsulation I can be prepared for any change in the requirements.

Heh, that reminded me of this.
posted by Brak at 4:27 PM on February 7, 2013 [1 favorite]


For me its more like taking an aggressive poop or maintaining an addiction: a struggle that feels so good when its done.

If you don't like (or love) creating software, then why do it at all? I mean, can't you make more money doing sales or marketing, or something like that anyway? I'd imagine programming is a miserable occupation for someone who doesn't have a yen for it.
posted by JeffL at 4:34 PM on February 7, 2013


can't you make more money doing sales or marketing, or something like that anyway?

Not likely in my experience. Top coding jobs pay insanely well.

I'm in the middle. I like coding well enough, but I wouldn't do it if I wasn't being well-compensated for it.
posted by wildcrdj at 4:45 PM on February 7, 2013


Not likely in my experience. Top coding jobs pay insanely well.

Interesting. I did software development for 12 years, then took a sales job for seven years, then left that to go back to software. Obviously it depends on the product you're selling, the industry, etc. but based on my experience, I believe that most people outside of sales don't realize just how much money good salespeople make. I was a mediocre salesman, and I could make a lot of money doing it. But I didn't enjoy it, so I went back to something that I love doing.
posted by JeffL at 5:06 PM on February 7, 2013


Yes to be fair I really mean that the top end pays incredibly well (senior jobs at places like Google, etc). There is a HUGE range of salaries in programming.

I do feel though that there is incredible pressure in the software world to claim you love coding so much and would do it for free and all you think about is code and.... so on. I believe this leads to an exaggeration of how much people love it versus do it for the money, since it could potentially affect your career / getting hired to admit its just a job and not your One Overriding Passion.

As someone who has been in the field for 15 years, I feel a lot less of that pressure (I have a record that can speak for itself), but I definitely know people who would be afraid to voice that, honestly, they do it for the money (of course, you're only getting paid a lot if youre good, but that doesnt mean its your Dream Occupation or whatever).
posted by wildcrdj at 5:22 PM on February 7, 2013


there *is* something internally epic about coding

Case in point: The Story of Mel, a Real Programmer.
posted by Mr. Bad Example at 5:43 PM on February 7, 2013


I do feel though that there is incredible pressure in the software world to claim you love coding so much and would do it for free and all you think about is code and.... so on. I believe this leads to an exaggeration of how much people love it versus do it for the money, since it could potentially affect your career / getting hired to admit its just a job and not your One Overriding Passion.

That's certainly true. The infantilization can be absolutely infuriating.

"We wanna hear how you're really passionate about the job..."
"I'm a pro. You pay me, I work. The end."

"We have all kinds of fun toys..."
"Which would be great if I was 8. Fuck you, pay me."

"We offer complimentary beverages..."
"At a value of up to $3 per week. Fuck you, pay me."

"What blogs do you read to keep up though?"
"Oh, you heard of mysparetimeismyownIamnotyourslavefuckyoupayme.com? Great stuff."

"Wizard Ninja etc etc etc etc"
"FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU PLEASE DIE."
posted by drjimmy11 at 6:03 PM on February 7, 2013 [10 favorites]


Yes to be fair I really mean that the top end pays incredibly well (senior jobs at places like Google, etc).

*Incredibly* well? Maybe I'm out of touch, but I've never heard of a programmer making more than say $250k. Which, don't get me wrong, is a lot of money to me, but hardly what I think of when I think of "paid incredibly well."
posted by drjimmy11 at 6:04 PM on February 7, 2013


Trochaic pentameter would read: "Harken to the iframes I have coded."

You are absolutely right, of course. I've been immersed in "Hamlet" for two months, and my brain is seeing blank verse where it doesn't exist.

My brain turned the comment into something like "Harken to this: the iframes of the page," which puts the first-syllable of "iframes" and the word "page" is stressed positions.
posted by grumblebee at 7:05 PM on February 7, 2013


The Hamlet-immersion is showing: What your brain turned the comment into sounds much nicer than my pentameter.
posted by Rustic Etruscan at 7:38 PM on February 7, 2013


DrJimmy11 -- I think any way you slice it, we're doing ok.

It would piss me off to find this code in our codebase. If, for no other reason, all those comments just make it more difficult to follow. Don't get me wrong, love goofy comments, but gimme something that actually helps. I mean... fuck. I get what the for loop does. Thanks.
posted by ph00dz at 9:55 PM on February 7, 2013


Yeah, fun - but wouldn't get through code review.
posted by dickasso at 6:35 AM on February 8, 2013


It would seem that somebody bought Thor a copy of Learn jQuery in 4 Weeks.
posted by whir at 6:43 AM on February 8, 2013


Sorry. I just really like the drink - it tastes like how I imagine Slurm would. I don't really like coffee. I got into computers and IT about the same time I discovered Mountain Dew in college - and I don't think that's coincidental.
posted by Slap*Happy at 7:50 AM on February 8, 2013




weston: Also, originally Elizabethan English speakers did not write JavaScript, or speak thus of ThyTube.
Ima gonna needa citation on that one.
posted by IAmBroom at 10:07 AM on February 8, 2013 [1 favorite]


> I've never heard of a programmer making more than say $250k. Which, don't get me wrong, is a lot of money to me, but hardly what I think of when I think of "paid incredibly well."

Out of curiosity, what's your bar, then, for "incredibly well"? $250,000 is in the 98.50% percentile for households in the U.S.* I'd imagine it's considerably higher for single earners. Not sure where "incredibly well" has to go from there, in any meaningful metric.
posted by Brak at 12:17 PM on February 8, 2013 [1 favorite]


I've never heard of a programmer making more than say $250k.

Base salary, perhaps. Programmers also get a lot of stock, and people who have the fortitude necessary to grind away in a faceless office at a giant corporation for years on end can end up making as much money from the yearly stock grants as they get in salary. The startup I'm working for is full of ex-Microsoft guys who walked away from positions like that, and some of my friends who have been working for Google a while are in the same boat now too.
posted by Mars Saxman at 1:23 PM on February 8, 2013


I was always a fan of dropping "Look on my works, ye Mighty, and despair!" in the header, myself.
posted by radwolf76 at 3:32 PM on February 8, 2013


Forsooth, bitches!
posted by Twang at 3:36 PM on February 8, 2013 [1 favorite]


« Older Wake up Sheeple!   |   Class Returns 401 Newer »


This thread has been archived and is closed to new comments



Post