5 ms·
Why all the new languages aren't white space based lang like Python ? Why they still need braces , braces are always hard to read the code and all modern code
by v3ss0n 4y ago
Why all the new languages aren't white space based lang like Python ?
Why they still need braces , braces are always hard to read the code and all modern code editor can work well with white-space based languages .
A native , non inerpreted , high performance whitespaced lang with memory safety , as simple as python would rule .
- sebmellen 4y agoI find whitespaced code harder to read. Autoformatters like Prettier make brace-based langs really easy to read and parse.
- 5d8767c68926 4y agoNim?
- Schroedingersat 4y agoZig has a canonical format where braces match indentation. You could probably make some simple tooling such that you never saw braces.
- flohofwoe 4y agoThat's entirely subjective, there are a lot of people who have the same negative opinion about 'whitespace matters' languages. I switch between Python and 'curly brace languages' all the time, it's really not an issue after the first three hours or so (but I still miss sometimes that I can't throw in temporary debug code into python with different intendation so that it stands out). Same with semicolons btw, some people make a big fuzz about it, but in the real world it really doesn't matter, especially with how common real-time linters are nowadays (which helps me a lot because I sometimes accidentally end a line in python with a semicolon).
- ghoward 4y agoBecause code formatters cannot work on whitespace languages like Python. They can't adjust the indentation for you because they have to assume that the given indentation is intended. It also makes a lot of other automatic tools for dealing with source code harder to write, if not impossible.
- chriskrycho 4y agoThis is simply not true.There are highly-used and highly-usable formatters for Python, Elm, Haskell, F♯, etc., all of which are whitespace-sensitive/indentation-dependent languages. "Adjusting indentation" is far from the only thing formatters do, and even things like breaking or wrapping expressions over multiple lines can certainly be done in all of these languages.
- smegsicle 4y agoadjusting indentation may be "far from" the only thing your formatters do, but it's the only thing i ever want mine to do
- Tozen 4y agoI think you might have got that flipped around. I've known many more people that found white-spaced based languages harder on the eyes and more annoying to deal with.
- yellowapple 4y ago> Why they still need braces , braces are always hard to read the code I'm of the opposite opinion. I very much prefer braces or some other block delimiter over having to slap a ruler on my screen to know which scope I'm in.