F***ing Javascript Conventions

I just changed things around a lit­tle on my blog thing so that when you click on a com­ments link it will spawn a lit­tle com­ments win­dow (if you have javascript, oth­er­wise it will behave as nor­mal) so that you can look at com­ments aside from the blog itself. The script is sim­ple; it works; it does what I want.

There is, how­ever, one prob­lem. The con­ven­tions (and pos­si­bly the spec­i­fi­ca­tions) of javascript are such that when defin­ing a new func­tion you have to put the open­ing brace (‘{‘) on the same line as the func­tion dec­la­ra­tion. Placing the brace on the same line as the func­tion dec­la­ra­tion is some­thing that I absolutely loathe; I want my open­ing brace (‘{‘) to line up ver­ti­cally with my clos­ing brace (‘}’). If other peo­ple want to put the open­ing brace on the line with the func­tion call that is their busi­ness (and they are hideous peo­ple for it because it makes their code less read­able) but I am not going to force them to do it my way and as such they should not force me to take up their abom­i­na­tion of a syn­tax. I hate it so much that I put the whole func­tion on one line (good thing it was a sim­ple function).

There, that’s my angry tirade against javascript. I seem to remem­ber dis­cov­er­ing this atroc­ity and being equally dis­gusted at some time in the past too. Oh, and don’t even get me started with peo­ple that don’t know how to indent. I’m going to stop before I dou­ble the length of my blog com­plain­ing about cod­ing styles that I hate. Also, I know that my code isn’t per­fect either, but I like to think that it’s pretty easy to fol­low if you know what you’re doing.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

*