6 ms·
This is great! Its amazing how much more readable programming languages get when they drop the visual noise created by unnecessary keywords – there's a reason
by codesections 5y ago
This is great! Its amazing how much more readable programming languages get when they drop the visual noise created by unnecessary keywords – there's a reason math is so much easier to understand when it's expressed with symbols than with words, and it's very surprising how few programming languages recognize that.
(I notice a few comments describing this syntax as less readable. My first thought was that these comments were sarcastic/trolling, but I've concluded that they're serious – but written by programmers who think very differently than I do!)
- kbenson 5y agoMath is easier to understand with symbols if you've been trained in what all the symbols and syntax means, and virtually impossible to understand if you haven't. This is easy to miss because for the most part we have one unified syntax taught in most the world. Words may not be the optimal format to express equations, but are the lowest denominator that would allow everyone to understand if they knew the concepts. That should illuminate why your opinion and other people's opinion of this differ. You likely each have different relative opinions and skills reading syntaxes like this.
- avmich 5y agoI think you're too categorical. We don't only use words in written communication - there are pictures and symbols too, so restricting ourselves to spoken words in largely symbolic activity seems a disadvantage. For both math and programming it makes sense to invest into training of symbols and then get to the matter with expanded toolset, rather than keep using something more similar to COBOL. Tools are important for the progress. It's not a random event that digits - essentially symbols for numbers - were invented millennia ago.
- kbenson 5y agoI wasn't making a case that words are better than symbols, only that there's always a trade off between representing something using existing known syntax and a somewhat less known but more concise and exact syntax, and that tradeoff is largely defined by how familiar your target audience is with that syntax. C-like syntaxes are more popular than lisp syntax(for example) not because it's inherently better but because most people have some exposure to it at this point through other languages they have been exposed to. Interestingly, that actually does make it inherently better in some aspects when choosing a syntax to adopt, such as learnability. For the person that only knows C and the person that only knows Lisp, which might have an easier time with the average rust program? What about someone that only knows Prolog? The issue is not about only using words, the issue is about using things your audience already knows. People use numbers in letters not just because words are less convenient, but because words are less convenient and they know the people on the other end know Arabic numerals so that's a valid medium to rely on. For programming languages it's less that words are better and more that there are either different or conflicting meanings for many symbols leading to confusion for those that deal with multiple languages or are new to the current language, so time needs to be taken to internalize what they mean in this new context. That doesn't make them bad or worse than words, but often they necessarily are less obvious in meaning to those new to the language to benefit those that are more familiar or experts.
- void_mint 5y ago> Math is easier to understand with symbols if you've been trained in what all the symbols and syntax means, and virtually impossible to understand if you haven't. I haven't and it continues to be a massive source of shame. Maybe today's the day I do something about it.
- brundolf 5y ago> there's a reason math is so much easier to understand when it's expressed with symbols than with words Had to do a double-take to make sure this wasn't /s It's my opinion that the use of random symbols is the primary reason math is so inaccessible. It is for me, and anecdotally I've heard dozens of others say the same thing. The only imaginable benefit I can see to using symbols is that they're easier to write quickly on a chalkboard.
- dhosek 5y agoI remember sitting in the hallway of the building with the math department waiting for a class to start and picking up a booklet on a table with a style guide for writing mathematics and it specifically advised using words in place of symbols, e.g., preferring “for all x in the integers” over “∀x ∊ ℝ.”
- dhosek 5y agoD'oh, not integers, reals. Sigh.
- olvy0 5y agoI completely agree. For me it's less readable. I also think math is less accessible due to its use of random symbols that are context-dependent. "Readability" is a highly, highly subjective matter, and depends on one's education, background, knowledge, experience etc. People seem to use it as a shorthand for "math-like shorthand", but that's not what I mean when I say readable, it's like we speak in a different language. Personally I find the adjective "readable" a major trigger, it seems to be thrown around by people who are either trolling or who seem to live in a kind of a social (online) bubble and don't know anyone else with a even a slightly different background. This is always slightly shocking to me.
- wrs 5y agoDoes this mean you prefer Ada or COBOL to C or JavaScript? All symbols (and words!) are “random” if you haven’t learned what they mean. I remember when I transitioned from BASIC to C (this was a while ago) it seemed ridiculously terse and full of crazy punctuation, but C-like syntax is now considered “accessible”.
- reificator 5y ago> (I notice a few comments describing this syntax as less readable. My first thought was that these comments were sarcastic/trolling, but I've concluded that they're serious – but written by programmers who think very differently than I do!) Don't worry, I assumed the exact same about your comment. I still have to remind myself sometimes that people use Python because they think it's easier to reason about.
- Zababa 5y ago> (I notice a few comments describing this syntax as less readable. My first thought was that these comments were sarcastic/trolling, but I've concluded that they're serious – but written by programmers who think very differently than I do!) I think you have to take into account familiarity here. Rust uses "fn" for functions, which is really short (the same as := really), but it's easy to see how it's the short version of "function". On the other hand, := is assignment in some languages (usually Pascal descendants), and is used for "definition" in BDNF. That makes it hard to map it to "function".
- mkl 5y agoI'm not a Rust programmer, but I can read and mostly understand the Rust code I've seen. This by comparison is incomprehensible to me. Your analogy to maths doesn't seem to hold up, because I am a mathematician, and still find this syntax unreadable. To me it is almost the definition of "visual noise", as it doesn't use words where maths would, and contains many extra redundant-seeming symbols maths would omit. I also really like Python's indentation syntax, so I have no objection to that in principle. Take these three lines from the README example: |?| ^door <= 100 ^door_open[door - 1] !^door_open[door - 1] ^door += pass; Without the docs I don't have any idea what this does. Even with the docs it makes very little sense to me. |?| seems to start a loop, but it doesn't seem to be in the documentation (the closest thing is |??| for "while"). ^ means mutability, but is needed in the first line for some reason even though no mutation is happening? (Or is mutation happening? <= doesn't seem to have changed meaning though.) But then ^ is not needed on the mutable "door" in the second line? What does the second line do? It's not assignment, according to the docs, because that is a very un-mathematical prefix thing (but everything else, including other assignments like +=, is infix?). It seems to be just two expressions next to each other, and the docs don't seem to say that's meaningful. Why does the third line have a ;, but not the second? Is the second line somehow part of a statement finished on the third (which isn't indented)? Is the second line a ?-less condition affecting the third? I am not being sarcastic or trolling. I genuinely don't understand this. The assumptions I'm aware of making are (1) the documentation covers everything new in the new syntax, and (2) the example in the README is valid code in the new syntax. Serious question: do you understand these "much more readable" three lines?