Long Live the Semicolon and Why I Love it!
Saturday 24 October 2009 @ 8:23 am

 

OK, so we all want to be somewhat popular, and it seems that my last article, “To Brace Or Not to Brace”, seems to have gotten a lot of attention, so, here goes my opinion on the popular semi-colon argument.  First, I’m not against any languages in particular, but I have found that I do better in ones that have semi-colons.  One of the features I really like is the ability to move my line returns anyplace I want, and to indent as I see fit.  Though the semi-colon does not guarantee I can do this, it certainly makes life easier.

So, what’s wrong with using tabs to signal nesting levels and dispense with semi-colons?  Well, for me, that is just too hard.  I always seem to mess up and my code stops working.  What about line continuations?  I just have to ask why?  Want to continue, just press the return key.  Not much else to remember.

In College, I learned a language called PL/1 (long forgotten) that required semi-colons.  I remember the compiler would constantly spit out errors saying “Maybe you have missed your semi-colon?”.  I use to find that very annoying, but now, that I’m a semicolon lover, I just happily type them at the end of each statement I want terminated.

There are dissenters however.  For example, the TheMightyFavog says “Let’s get rid of it.  Nobody knows how to use the thing anyway”. 

Just my 2 cents.

Comments (7) - Posted in ASP.NET 2.0  




7 Responses to “Long Live the Semicolon and Why I Love it!”

  1. Jef Claes Says:

    In College, I learned a language called PL/1 (long forgotten) that required semi-colons. I remember the compiler would constantly spit out errors saying “Maybe you have missed your semi-colon?”

    –> When learning Java for the first time in school, after knowing Visual Basic, those semicolons annoyed me so bad. Now I love them as well. It’s even hard to chat without ending every sentence with a semicolon;

  2. BlackWasp Says:

    I love those semicolons. So much so, I add them every time I have to write a bit of VB. VB doesn’t like them so much though;

    ;)

  3. Giorgio Sironi Says:

    There are great examples (Python) of indentation usage instead of semicolons. Though, if your code is well-written it does not have many levels of indentation and this controversy is less important. :)

  4. Veera Says:

    I like the semi-colons too. All the languages, in which I’ve worked, are using ‘;’ for terminating a statement. the usage of ‘;’ gives me a logical break between more than one statement. if it’s not a ‘;’, i found it hard to understand the code.

  5. Helltime for October 26 « I Built His Cage Says:

    [...] fun post by Peter Kellner sings the praises of the semi-colon and indentation-neutral languages in general. I tend to agree. Dittohead programmers (yes we exist) [...]

  6. David Lucke Says:

    I’ve never been able to understand why the semicolon is loved so much. Its an extra character to type that performs no function. You’re already going to use a carriage return at the end of the line. Why isn’t that sufficient? Sure, you sometimes want to continue the same statement on a separate line because its so long, or something. But that’s fairly rare, so why not use a continuation character for that instead of requiring an extra character on every single line?

  7. Carno Says:

    David Lucke has a point, I am a VB.Net coder too and “;” is not required.

Leave a Reply