Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Semicolons give me comfort

DZone's Guide to

Semicolons give me comfort

· Web Dev Zone
Free Resource

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

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?

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.

Topics:

Published at DZone with permission of Robert Nyman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}