Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But the language spec for Python is what allows for this, not the compiler. \n is just the magic character now except now we also need a \ to make multiline expressions. It’s all trade offs, compilers are not magic


> now except now we also need a \ to make multiline expressions.

You never need the backslash in Python to make multiple expressions. There's always a way to do multiline using parentheses. Their own style guidelines discourage using backslash for this purpose.


And you can also do it with triple quotation marks if strings are involved, but it’s still more work for the compiler that someone explicitly did, it’s not magic.


Plain strings work fine. Python has the same behavior as C: If two strings separated by whitespace, it concatenates them. So if I have a long string, I start with an open parenthesis, type one string, go to the next line, and another, and so on over several lines. Python sees it all as one string. Very readable.


Scala then. Semicolons are optional but you still can have them if you need them


The obvious example would have been JavaScript, but nobody wants to say something positive about JavaScript...


JavaScript has some specific and unique issues. Some silly choices (like auto inserting of semi-colons after empty return) and source code routinely, intentionally getting mangled by minification.


> but nobody wants to say something positive about JavaScript...

For obvious reasons...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: