Semicolons give me comfort

The other day at work we had a discussion about how code should look, or rather, what characters to use.

It all started when I made the comment:

I like semicolons, they give me comfort

Immediately I had three Ruby on Rails developer laughing so hard tears would come out of their eyes. “Semicolons, such bullshit. Look how clean OUR code is” (Clean where? However, preprocessing code with no idea of the output is a topic for another day…). So, we talked about it in a more sensible manner, once everyone had calmed down, and it got me thinking.

Why do I feel comfort in semicolons? Should just line endings just be good for most purposes? Cleaner, less noise etc. I think it all stems from me doing JavaScript development for about 12 years now – semicolons is like a safety line, a way to control (or rather, not rely on) semicolon insertion in JavaScript. Also, with objects, multiline statements etc, it just feels good to have.

But from another point of view, I think for me it’s also about punctuation. No matter if some statement is one or several lines, no matter what characters it contain; when I see the semicolon I know that that specific statement is over. That gives me comfort.

Or do I just want Douglas Crockford to like me?

What are your thoughts on semicolons and how code should look like?

Posted in Developing,JavaScript,Technology |

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>