Hacker News new | ask | show | jobs
by evilvoidhamster 5244 days ago
problem here is ruby.ruby developers hate semicolons. They ignore the decades old history opf the semicolon, and assert that the ruby/python/haskell way of indentation and semicolon-less code is the better way. They COULD be right, but im too deep seated in C/C++/Java/JS. One of the problems with javascript is the fact that it gives the choice.
3 comments

Agreed.

The first language I learned was VB6 (ewww), after that C, C++, Java, JavaScript and PHP, only a few years ago I started to hear a lot about Python, Ruby, etc.

I don't see what's the problem with the braces and semicolons, I got used to write them and I don't see it affect my coding speed or code readability, in fact I find it easier to read code with braces and semicolons, I learned a little of python a few months ago and ignoring the fact that I do not know the language syntax very well (or more common libraries) yet, I write it as quickly as I would write Java/C etc, for readability I read python slower but as I said I'm not used to the syntax/libraries/etc yet so that may be the problem.

Actually, Haskell lets you do it either way. It's the best of both worlds :)

This code:

    do a <- [1,2,3]
       b <- [4,5,6]
       return $ a + b
can also be written as:

     do {
       a <- [1,2,3];
       b <- [4,5,6];
       return $ a + b
     }
or:

     do { a <- [1,2,3]; b <- [4,5,6]; return $ a + b; }
I've even seen it like this:

     do { a <- [1,2,3]
        ; b <- [4,5,6]
        ; return $ a + b }
JavaScript also permits you do it either way. That's what this whole argument is about!
I'm merely responding to the parent's "ruby/python/haskell way of indentation" phrase.
Actually, it has nothing to do with ruby. The problem here is that some people use minification tools that rely on semicolons. If that weren't the case, this would be a total non-issue.