How on earth do you prefer tabs to curly brackets?!?!
How on earth do you prefer tabs to curly brackets?!?!
Similarly, when considering JSON versus YAML or TOML for human readability, the same principles apply. Personally, I find indented code more readable, but this can be easily attained in most languages with universal code formatting rules and intelligent code editors that highlight different elements to improve readability.
I find code block which are delineated by brackets so much more readable than ones delineated by invisible characters. Especially at a glance
I don’t love do..end either, but still prefer them to arguing with Python about the level of indenting not being correct or that spaces were used somewhere somehow.
> this can be easily attained in most languages with universal code formatting rules and intelligent code editors that highlight different elements to improve readability.
Ofc, none of this is a practical issue, but that’s what makes it a fun topic of discussion ;)
Every human communication mechanism includes deliberate redundancy to ensure that the meaning gets through even in suboptimal situations. Programming languages are somewhat unique in having a strong movement towards eliminating all redundancy.
I don't understand how people prefer curly braces, a character that is almost always has other meanings within the same language, instead of something like `end`. To that (ahem) end I don't understand how people prefer `end` to the exceptionally clear `endif`. Turns out different people have different preferences :D
I don’t understand how people prefer invisible characters which change sized depending on the editor to visible ones which are consistent and easy to scan for.
And ya I also don't appreciate having to care about formatting for my code to compile and not being able to put debug statements at column 1 so they stick out like a sore thumb, though I suppose the solution to the latter is to stop being a puts/print debugger but, like... no :)
In general, how is significant whitespace both a thing, and popular?
Python of course still has invisible issues like silent invalid identations in `if` clauses, for example. Well, you could fix those with copious amounts of tests, of course.
Same goes for YAML where invalid identation can will still be easily valid YAML.
never once did we (and I have some bad apples at work) hit a problematic indentation in conditionals or other structs
i'm honestly surprised
The best solution is to ban tabs entirely from the syntax - only allow spaces in multiples of 2.
Curly bracket blocks are obviously visible at a glance. If I incorrectly move one around it’s obvious.
If I shift tab a section of python code around, I may be breaking an if state without noticing if I didn’t pay attention to a specific colon on one line.
Imo s-expressions are the easiest to move around, but have the same issue of being hard to scan as tabs.
I've gotten used to a lot of things that I'd rather not have to deal with.
it's not just a matter of preference -- "no-curly-brace" dogma means it's impossible to do multiline lambdas in python
you have to see ruby's popularity to see whether "it's despite or because of"
https://survey.stackoverflow.co/2024/technology#2-programmin...
According to this chart[0] higher on the same survey report, JavaScript is the #1 most used, and Python is #3.
But, I don't see this as a contest... being "the most popular" programming language doesn't automatically make it the best choice for a given task.
[0]: https://survey.stackoverflow.co/2024/technology#most-popular...
https://www.tiobe.com/tiobe-index/
I think since the AI boom, Python took over.
Which is to say, very little.
Helps readability, quick visual hint of structure and i don't have to keep track of open-end brackets.
Though i much prefer spaces to tabs.