Learn to program with Wisp, a Lisp without parentheses
draketo.de
draketo.de
Languages that try to be concise are like textspeak. Its fast wen u jst need 2 send throwaway msgs lol. That's what makes them popular for scripting: writing a quick script is like writing a quick text. It's "write-only". But you would never write a technical document out of textspeak: clarity is much more important than brevity. So it is with serious programming languages. It makes invisible-punctuation languages feel like toys. And yes, I'm even including Tensorflow with Python: those are still mostly "write-only" scripts that are not meant to be maintained like professional software is.
Stop making your punctuation invisible.
The only real pain point with indentation based languages like Python is when copying and pasting code you have to take care to put things at the right level. Tools like prettier mean this is pretty much a non-issue now for punctuation based languages. But there's still a lot of line noise to ignore when reading code.
def outermost():
def middle():
def innermost():
...
(six hundred lines of code)
...
return something_from_innermost
def another_func():
Uh oh. Is "another_func" at the right indentation level? It's very hard to tell what scope it's at. Yes, this is awful code style, and it still would be difficult even with visible punctuation, but at least you could count the '}'s to see what the programmer actually intended. Here, it's very difficult to know how many scopes just closed. They all opened five screen-heights ago! I am aware that it's easy to write hard-to-follow code in any language, but visible punctuation always helps.at the same time, I'm somewhat interested to hear a further defense of this idea that newlines and spaces are "invisible". Is this invisible in the sense of neutrinos, or in the sense of wind blowing in the trees, or in the sense of the vacuum of space, or what?
For my part, I seem to have no trouble "seeing" line breaks, spaces between words, etc.
Sometimes I feel like the fixed visual pattern of whitespace punctuated code gives strong contextual messaging about flow and structure, speeding up interpretation and understanding. Sometimes I feel that it’s vague.
Carefully written and well prettified character-punctuated code presents a deterministic clarity that helps to better encapsulate little chunks of functionality that become easy to identify and think in. OTOH punctuation can lead to character-soup situations where parsing exerts significant drag on comprehension speed.
I don’t know what the answer is, but in using either paradigm I find that they both have their strengths and weaknesses. I sometimes vaguely wish that this could be tweaked at the IDE level, like if you hover over a python block for a while it drops in curlies and semicolons for clarity, and if you hover over some overpunctiuated-to-the-point-of-obfuscation soup it pops out into a spacial structure that better exposes the structure being expressed.
I think it really boils down to being aware of the pitfalls of each paradigm and adjusting your coding style to minimise those impacts. But that doesn’t help when you are dropped into someone else’s codebase.
Realize that you can still do this with punctuated languages. In fact, the parser being whitespace agnostic means you have full power to use it however you deem best improves clarity, whereas whitespace-as-punctuation languages do not have nearly the same flexibility here. However much you liked fixed visual patterns of whitespace, that's an argument against whitespace-as-punctuation languages for that reason.
The problem is that many people seem to be unaware of code morphology as expressive documentation. To a degree, whitespace punctuation enforces expressive morphology and encourages thought in that direction.
It’s like the syntax we deserve, not the syntax we want lol.