5 ms·
Anyone who hasn't tried a whitespace-significant language in anger is missing out. I had started with F# and was put off by it like you described. I moved to H
by davidgrenier 9y ago
Anyone who hasn't tried a whitespace-significant language in anger is missing out.
I had started with F# and was put off by it like you described. I moved to Haskell and had difficulty understanding it yet again, but when I moved back to F# one more time it was a delight.
- dorfsmay 9y agoI LOVE python, it is the weapon I first take to any battle and the language I recommend to beginners. But, I have to admit that the fact that it is so easy to lose track of which "if" a nested "else" belongs to when modifying code, and, I've seen this being the source of so many bugs, that it has changed my opinion about whitespace-significant languages. Also, I've come to appreciate when I write in say Rust, the fact that I can let go of the syntax, just write and focus on my ideas and let my editor sort the mess at the end.
- daveFNbuck 9y agoHow does Rust make it any easier?
- dorfsmay 9y agoAll clauses are defined within curly brackets like C so indentation has no meaning and you can let tools take care of that.
- vram22 9y agoAlso, with editors like vim, you can press % to go to the matching brace (curly bracket). In fact that works in vi too, right from the early vi days; also, in vim, if you position the cursor on an opening or closing brace, it momentarily highlights the other one (at least if that brace is visible on the screen, can't remember offhand if this works even if not visible). I still like languages like Python and F# though.
- daveFNbuck 9y agoBut is it any easier to tell which clause an else is connected to? Python has tools too.
- dorfsmay 9y agoWhen you refactor, yes. In python, say you add a new condition inside a condition, it's really easy to get lost and indent the wrong one to the wrong level.
- bjz_ 9y ago> it is so easy to lose track of which "if" a nested "else" belongs to when modifying code, and, I've seen this being the source of so many bugs, that it has changed my opinion about whitespace-significant languages. Having types and removing statements from the language make this much less of an issue > I can let go of the syntax, just write and focus on my ideas and let my editor sort the mess at the end. Elm has a whitespace significant syntax, but it too has an excellent code formatter tool.