3 ms·
I strongly disagree. I think that style is a matter of taste, and some part of syntax can be regarded as styling decisions, like with placement of tabs vs spac
by stephc_int13 4y ago
I strongly disagree.
I think that style is a matter of taste, and some part of syntax can be regarded as styling decisions, like with placement of tabs vs spaces, braces alignment, snake_case vs camelCase etc.
But there is a continuum of syntax readability, brainfuck is less easy to read than Perl that is still easier to read than Sed.
And I think exactly the opposite about familiarity, the less familiar you are with a syntax the better your judgment is about its readability.
Of course that can be learned, but that is not the point.
Programming languages should really strive to be as easy to read as possible, even at the cost of being more difficult to write.
Code should never look arcane, especially to someone unfamiliar with the language / codebase.
- klibertp 4y agoBrainfuck is harder to read not because of the syntax, but because it describes very low level semantics. Actually, it's not even harder to read - it's harder to comprehend. You're conflating comprehensibility with readability - they're not the same. There's a reason why people get tested for "reading comprehension" and not just "reading". In other news, I now know that you have your own idea about how programming languages should be. Good for you. That idea is not grounded in any research, because there is no research available, but you're welcome to have it, and when you write your own language you're welcome to stick to it. Logical conclusion of your last statement is this: https://en.wikipedia.org/wiki/Inform#Example_game_2 https://en.wikipedia.org/wiki/Inform#Example_game_2 I'll leave you to think about why it's not the most popular programming language on the planet. I'd say more, but I don't want to inconvenience Daniel any more than I already have the previous time, so let's just strongly agree to strongly disagree.
- stephc_int13 4y agoEasy to comprehend, easy to read, alright, in this context I think they are close enough to avoid wasting time on semantics. I have some ideas about programming languages but I think that in this field less is more, in an ideal world we should have only a handful of programming languages, to avoid the huge waste of resources.
- hbrn 4y ago> You're conflating comprehensibility with readability - they're not the same. There's a reason why people get tested for "reading comprehension" and not just "reading". "Reading comprehension" is not the same as "reading" only for natural languages, because we can "read" words by transforming them into sounds. In the context of programming, reading and comprehending are synonyms. Nobody cares if you can "vocalize" the code without comprehending it.
- klibertp 4y agoMaybe nobody cares, but visually identifying a token and comprehending its meaning are still distinct steps. What I'm trying to say is that visual identification - the thing that syntax is responsible for - is the easy part, and the latter is so much harder that the former almost doesn't count. It's not that I think syntax doesn't matter at all. It does, in some context it matters a lot - just not because of readability. And most definitely not because it looks pretty or ugly.
- firstlink 4y ago> brainfuck is less easy to read than Perl You are using a very strange definition of "easy to read". Brainfuck is obviously easier to read than Perl. There are only a tiny handful of symbols and there is a 1-1 mapping between characters and behavior in the program.
- stephc_int13 4y agoSure, then I guess that binary code is the easiest to read, even easier than hexadecimal.
- klibertp 4y agoAgain, yes, it is easier to read. In binary, there are only two tokens you need to recognize. With hex it's 16. With binary, when you see 1101, you only need to recognize two distinct tokens. You can teach a toddler (or maybe even a parrot) to read it in a day, and you'll get to "one-one-zero-one" in no time at all. Now, understanding what this particular combination of tokens means in the context it appears in, is obviously much harder than if it was given symbolic name, ie. when using assembler. But reading assembly is obviously much harder than machine code (dumped in binary), because you either need to learn the whole alphabet ([a-z0-9] and a few more) the identifiers are formed from, or you'd need to memorize and learn to recognize hundreds of labels. Not something a toddler could do in a day. Reading and understanding are not the same. You, and some other commenters, want to overload the term "read" to mean everything from first seeing a clump of pixels or a stains of ink on paper up to forming the mental model of the semantic meaning that's solid enough to be transformed in your mind (ie. having an understanding). I'm telling you: it's not that simple. I'm also trying to tell you that it doesn't matter, because "forming a mental model" is so much harder than just recognizing visual patterns (ie. reading), that the difficulty of the reading part is inconsequential. There's a pop-sci book titled "Programmer's Brain" - it could be like 3 times shorter if it dropped the irritating long-winded style, but it does explain how interacting with code works from the cognitive science perspective. It's a few bucks well invested if you're actually interested in knowing facts instead of going with your gut feeling.
- 4y ago