Being explicit with your code

Posted by Peter J. Jones on

Christian Heilmann has a well reasoned gripe for developers omitting semicolons in JavaScript:

Why would any intelligent person want to make it harder for others to understand what they’ve done, keep booby-traps in their code that will cause errors or deliberately write in a way that might make others stumble? Is this some kind of code-trolling I don’t get?

I have the same exact complaints when people don’t use parentheses in their Ruby code. You can argue all day about your reasoning but when you run your code through ruby -w you’ll see all sorts of warnings about ambiguous code.

About the Author

Peter J. Jones has been using Ruby professionally since 2005 and is the author of Effective Ruby: 48 Specific Ways to Write Better Ruby. He speaks at Ruby events from time to time and teaches several Ruby-related workshops. Peter can be reached through our contact page or his twitter account.