3 ms·
> And if you don't write braces in a language that uses braces, it will also get ambiguous. What's your point? Not when they are mandatory, which they are in a
by pdimitar 5y ago
> And if you don't write braces in a language that uses braces, it will also get ambiguous. What's your point?
Not when they are mandatory, which they are in a number of languages (also the "do" / "end" blocks). You have no choice but to write valid code. I prefer it that way. Zero ambiguity.
> a { b { c; d { e } } f }
Whoever writes such code should be shot. There are newlines for a reason. And I am glad we have format-on-save these days. Less bikeshedding, exactly of the kind we're doing right now.
> easier to parse than this:
It's not for me, and not for one big chunk of the programmers. ¯\_(ツ)_/¯
> You shouldn't disregard a language just for superficial syntax features.
Daily productivity that is taking a nose dive due to constant fight with a system my brain doesn't want to work with is not superficial. That's like trying to tighten screws with two sticks -- it can likely be made to work, but it can take a long time and will be unproductive.
- xigoi 5y agoYou've inspired me to create this: https://github.com/xigoi/nimdenter/ https://github.com/xigoi/nimdenter/ >Whoever writes such code should be shot. There are newlines for a reason. And I am glad we have format-on-save these days. Less bikeshedding, exactly of the kind we're doing right now. So do you use indentation or braces to read code? If the former, what are you complaining about? If the latter, why would you use a tool that adds indentation when you already have braces?
- pdimitar 5y agoI am not "complaining" about anything. I am expressing preferences. There were online examples where people don't indent Python code as they go and then saving the file invokes LSP's auto-format which severely botched the code logic (and it was hard to spot). Seeing one such occurrence immediately triggers my alarms: I want to write code and be productive and not squint at whether I am at the right indentation level all the time.