|
|
|
|
|
by michaelmrose
1323 days ago
|
|
Edit: This example actually contains the symbol for a clock which in an unintentional illustration of the point renders just fine in editor and terminal but not here. Lots of languages support using special characters in symbols. Clojure for example. user=> (defn [x](+ 1 x))
#'user/
user=> ( 7)
8
In most cases this is going to be spurious a textual description of the operation is easier to type, more descriptive, more memorable.Your symbol of choice may have multiple look alike characters, may not be present in a different users font. Your fellow user may not know how to enter the characters you choose. The text labels inc or increase are both more memorable, understandable, trivial to disambiguate and easy to work with and your fellow user will not be cursing you as they scan your code for the right character to cut and paste especially if it looks like a square with a hex number in it because they can't render it. Math is an extremely dense formation of a an idea full of useless single character labels that make sense only to initiates. This isn't a great feature for code to emulate. |
|
Most don't.
> In most cases this is going to be spurious a textual description of the operation is easier to type, more descriptive, more memorable.
"easier to type": depends on you keyboard layout…
"more descriptive": depends on the operation; a lot of math symbols for example need pages long descriptions when written out…
"more memorable": depends on your native language, and the language the text description is written in…
So to summarize: No, no, and no. ;-)
> Your symbol of choice may have multiple look alike characters, may not be present in a different users font.
This is also true for any text description. Who says ASCII symbols are universal?
Like it's completely possible to not have for example symbols for an African language installed, it's also completely possible to not have any ASCII font installed!
The solution is trivial: Just install the font needed to display the language you want to read.
"Look alike" symbols are irrelevant in this context. (And by the way one of the many things that Unicode got very, very wrong; the need for Unicode normalization is just brain dead; especially as there's more than one normalization mode, and they yield completely different and incompatible results; but let's not criticize Unicode here as this would become to long for this post).
> Your fellow user may not know how to enter the characters you choose.
Well, that's the point of keyboard layouts, and the mentioned extensions like the compose key…
That's nothing that should be a barrier for someone who likes to program a computer.
If you're unable to cope with switching the keyboard layout you'll be likely unable to cope with anything related to programing. So I see no issue here.
> The text labels inc or increase are both more memorable, understandable, trivial to disambiguate
Again: Please don't assume that everybody on earth is an English native speaker! In case you didn't know: Most people aren't. (Yeah, I know, especially US people don't recognize anything beyond their borders; but there's actually quite a lot, like most of the world, for example ;-)).
Also the given example is funny, as quite a lot of languages use a symbol for "increase"… Ever seen a `++` somewhere?
Abbreviations by the way are symbols! (And they share all the understandably / discoverability issues of symbols).
Symbols need of course some written out form, at least for lookup / search.
But abbreviations aren't just aliases (like well used symbols), which makes them even worse than proper symbol usage.
> easy to work with
What do you mean with that?
> your fellow user will not be cursing you as they scan your code for the right character to cut and paste especially if it looks like a square with a hex number in it because they can't render it
You need to install fonts…
But that's a solved "problem" since decades! Most systems come with preinstalled fonts for all of Unicode, since "forever".
> Math is an extremely dense formation of a an idea […]
Which is exactly what people wanted. Because it fits the use-case extremely well.
And like I've pointed out already: Code is like math. Reading (and understanding) code activates the same brain centers as reading (and understanding) math.
> […] full of useless single character labels that make sense only to initiates.
The "single character labels" are symbols, too.
They're not useless by the way. ;-)
And when we're at it: Calling math "useless" is ridiculous.
That one needs to understand the domain one works in is nothing unexpected. Code in general also doesn't make sense to outside people. No mater whether the symbols are written out or not. I could simply show you ADA or COBOL code to prove that. ;-)
> This isn't a great feature for code to emulate.
I don't argue to use only symbols; as I stated already before.
But common "language level" syntax would be better expressed in a symbolic way. Long words are only noise. They don't provide any benefit in reading (or understanding!). Quite the contrary as our brain needs more time and capacity to recognize them. That's one of the reasons why mathematicians prefer symbols. Symbols are just way simpler to read and understand quickly!
Of course you need to learn the symbols. But that's equally true for the written out forms! Code doesn't become "intuitively" understandable when written out in human language.
It becomes actually less understandable as you need to parse (and remember!) much larger chunks to get the meaning. A human brain has only max. 5 seconds of working memory (most people have less). Long words use up this capacity much more quickly than short symbols. That's a fact. (Just look up who can do better mental arithmetic on average, and how this correlates with the length of word used for numbers in the native language of those people).
Of course not everything should be abbreviated. Only things where it makes sense.
Someone who knows some language should be able to read code in that language without "learning Chinese" first. (That's why I actually don't like abbreviations in code: Because you can't understand such code without first learning the—quite often completely random and ad hoc—abbreviations someone who never heard of code-competition introduced for no reason).
But having noisy long written out symbols for language constructs is just not helpful. It's even an obstacle to quick reading of code. (Just go out and try to read larger chunks of ADA. You will realize quickly: Reading such code is actually very exhausting!)