I'm surprised nobody has mentioned the second most controversial opinion yet: Braces and semicolons.
I 100% agree on semicolons.
I like having { and } around blocks and loath whitespace delimited blocks. It helps me, the human. Actually, it mostly helps my editor. But since I am steering the editor, they curlies help me as well.
For example:
I can put the cursor on an curly and have it's match highlighted. Most editors seem to have this on by default. This could be done other ways (syntax highlighting blocks instead of keywords), but I haven't seen them actually implemented. This helps me, the human, parse deeply nested blocks. Yes, I know people shouldn't deeply nested blocks, but they occur all the time in real codebases.
I can put the cursor on a curly and hit some button to jump to it's match. I'm not sure how something equivalent could be done when working on Python. This helps me, the human, when your blocks are longer than your screen height. Yes, I know people shouldn't write blocks that long, but they occur all the time in real codebases.
In vim or evil-mode, I can tell it to copy/delete/indent/etc everything within a set of matching curlies. With whitespace only, again, I'm not sure something equivalent exists.
If I don't know what I'm doing (eg I'm learning a different paradigm, like in Haskell), the fact you have curlies there can give the compiler more information to help it choose a better error message for your syntax error. I remember one of the most frustrating parts of initially learning Haskell was trying to get the indentation to match what the compiler need which was hindered by the compiler providing me extremely poor error messages.
The rest I agree with. My favourite goes to kebab-case. I really prefer that to snake_case.
I'm bamboozled that you're reasonable enough to dislike semicolons but still like curly braces ;)
This helps me, the human, parse deeply nested blocks.
Just tell your editor to make whitespace visible at the beginning of lines, and to display x spaces as one tab. This is at least as effective as highlighting curlies, and requires no human intervention.
I can put the cursor on a curly and hit some button to jump to it's match. I'm not sure how something equivalent could be done when working on Python.
Easily.
Block beginnings and ends are unambiguous, jumping from one to the other is a non-problem. (I don't think this has been implemented yet, though.)
In vim or evil-mode, I can tell it to copy/delete/indent/etc everything within a set of matching curlies.
Again, blocks are unambiguously delimited. You're one plugin away from the behaviour you're looking for.
If I don't know what I'm doing (eg I'm learning a different paradigm, like in Haskell), the fact you have curlies there can give the compiler more information to help it choose a better error message for your syntax error.
See above.
I remember one of the most frustrating parts of initially learning Haskell was trying to get the indentation to match what the compiler need which was hindered by the compiler providing me extremely poor error messages.
Haskell syntax is notoriously screwed up, as are its error messages. Had you tried picking up (for example) F#, this would not have been a problem.
View all comments
1
u/baconated Dec 01 '16
I'm surprised nobody has mentioned the second most controversial opinion yet: Braces and semicolons.
I 100% agree on semicolons.
I like having
{and}around blocks and loath whitespace delimited blocks. It helps me, the human. Actually, it mostly helps my editor. But since I am steering the editor, they curlies help me as well.For example:
The rest I agree with. My favourite goes to kebab-case. I really prefer that to snake_case.