Wednesday, January 26, 2011

Reqiuem For a Prejudice

Jack, they had me a long time ago.
--this isn't a real quote**

First of all, this is not about men who talk in annoying pseudo-falsetto voices and cut off their balls for reasons other than cancer:  I still hate them.  No, this is about curly braces:

{}

For those of you who are not programmers, curly braces are a method of grouping lines of code together, similar to the way a poem is organized into stanzas.  The difference is if you get a stray line in the stanza of a poem, your computer doesn't freak out at you.  Also, this kind of poetry keeps the stock market ticking.  Anyway.

There are many debates on the subject of programming languages.  For example, some languages have curly braces and some do not.  Some of the people who prefer languages without curly braces like to look down on people who use languages that do have curly braces, and say they are bad programmers.  Some of the people who use the languages with curcly braces say the ones without are bad programmers.  That's only the tip of the iceberg.  Basically, there are hundreds of meaningless ways to group programmers.  Usually what people do is come up with some line, some difference between you and a group of other programmers, and write a blog post about how dumb the other programmers are.  Such a blog post is typically based on bias, prejudice, personal anecdotes and lack of experience instead of any shred of empirical evidence, which causes people who already agree with you to agree with you more, and people who already disagree with you to think you are an idiot.  That's pretty much how programming debates work.

For example, one debate is between whether the language called Java should be used for everything, all the time, because its teh best language evar, or if the language called Ruby should be used for everything, all the time, because its teh best language evar.  Another common debate is whether or not someone's favorite new toy (like object oriented design, SOA, ruby on rails, HTML version gayass, REST, AJAX, shards, "object oriented" databases*, functional programming, web 2.0, lisp, the semantic web, mojo, your mom) is the best thing evar and will solve world hunger, cure cancer, and cause world peace, OR if its simply not that great.

The debate I felt most passionately about was the curly braces debate.  In all of computer science there is no debate more contentious and more meaningless than the placement of curly braces.  For the sake of brevity, I will describe it as a battle between the following two options:

Option 1, or "opening brace goes on the same line"

yourHatLooksGay(){
  //do they make them for men?
}

Option 2, or "braces line up"

yourHatLooksGay()
{
  //do they make them for men?
 }

I was a fervent zealot of option 2.  I jumped at the chance to defend my opinion, and while coding I would occasionally think about the witty, awesome and incredible arguments I would use to proverbially slay those ignorant, retarded, base, fools who dared believe that option 1 could ever be acceptable.  I even spent hours "fixing" other peoples code to get rid of those blasphemous curly brace positions.

Then, I was forced to use option 1 at my job.

Years later, I now use either interchangeably, relying on whatever style is used in the file I'm looking at.  Its like I just don't care anymore.  The voice inside my head that screams for everyone do to it my way has fallen silent, and, in fact, I now see positives and negatives to both versions, and I even end up using option 1 in personal projects out of habit.  Gasp!

It gets worse.

I used to love a special text editor called Eclipse.  If you're not a programmer, picture something like Microsoft Word, only more complicated, and less retarded, but not that much less retarded.  Anyway, I fell in love with Eclipse fast:  my friend Duc showed me the F3 trick that takes you to a symbol definition, and I went head over heals with all of the neat tricks you can use to effortlessly zoom around the code base.  Other people disliked eclipse;  I loved it.  Occasionally I would ignore yet another nerd saying I should use emacs or vim, or yet another moron bitching about these fancy editors making us poor programmers--which is bullshit, by the way:  I cut my teeth on C++ and therefore unlike people who started with java/ruby/python I actually know how to use pointers, which I believe makes me smarter than at least 50% of programmers out there (I get past the remaining 49% on mostly hubris).  So to summarize:  eclipse = awesome.

Then I started working here.  In order to make eclipse function with what must be one of the most pathetic version control systems on the planet, an Eclipse plugin was written to adapt the two together.  Now, I don't know if that plugin is to blame, or what, but using Eclipse here means having it freak out every once in a while and destroy your workspace.  This causes you to then spend anywhere from 30 minutes to two days fixing your tool chain.  Well, ladies, and gentleman, Eclipse crashed one too many times.  Are you still reading this?  I mean, seriously.  This post has gotten so boring I am being distracted by urges to go do my actual work, because that is more interesting.

Yeah, so I'm trying to code on the command line again, with vim.  And then there was a funny story that I can't tell you about because of NDAs and our internal software, and omygosh I'm bored.

In summary, the trick to sounding smart is to put down both sides of a debate.  I know this, because I typically think both sides of a debate are all idiots anyway, and sharing this view has made people think I'm smart.  It feels so good.

And something about...here laid to rest is my...the curly braces...oh who cares.


*object oriented databases:  unlike everything else on that list, "object oriented" databases don't actually have much value in any situation, except for solving the toy problems used by vendors trying to push "object oriented" databases.  Of course, this is not to say that a pure relational database should always be used....

**there is a quote that sounds a lot like this in some movie I've seen sometime in my lifetime.  I'm pretty sure a male character said it, and there is a "they."  That's all I can tell you, but if you happen to know the movie I'm referring to, please let me know.

No comments:

Post a Comment