4 ms·
I will note that the article doesn't contain the word "readability". APL is the classic example of a "write-only" language.
by _rgek 5y ago
I will note that the article doesn't contain the word "readability". APL is the classic example of a "write-only" language.
- bluejekyll 5y agoDo you have any examples?
- skruger 5y agoIt really isn’t. Thousands of APL programmers read it perfectly well. I can’t read Japanese, but that doesn’t make it lacking in “readability”.
- rightbyte 5y agoYou could argue just that. Japanese is surely more difficult to learn to read with its mix of Japanese and Chinese symbols, then say Russian or Greek.
- celeduc 5y agoLanguages have varying costs of entry and mastery. The relative cost depends on what languages one already knows. But some language features are rarer and more difficult (declensions, conjugations, symbols, tones, etc). The size of the active vocabulary matters a great deal. But the availability of the language matters perhaps most of all.
- dreamcompiler 5y ago"Language X is a write-only language" seems to be code for "it doesn't look like C." I've also heard Forth and Lisp described this way. And yet I find both readable since I have experience using them. I wonder if APL is similar: It's only unreadable to people who don't know the language. Well of course it is.
- ddek 5y agoAPL is different from Forth and Lisp, in that the 'write-only' reputation is supported by it's programmers. Take the famous 'game of life' APL example: ``` life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵} ``` It's quite logical, when you walk through it.[0] But it's harder to read 'back to front', which is what code readability is about. [0] https://www.youtube.com/watch?v=a9xAKttWgP4 https://www.youtube.com/watch?v=a9xAKttWgP4
- eggy 5y agoI would also recommend Conor Hoekstra's version of that video for a bit more explanation: https://www.youtube.com/watch?v=pMslgySQ8nc&t=45s&ab_channel=code_report https://www.youtube.com/watch?v=pMslgySQ8nc&t=45s&ab_channel... And he even shows how you can animate it in the editor window.
- rbanffy 5y agoI can say confidently I couldn’t figure out what a line of APL code did 2 hours after writing it myself. I had to write comments at almost 5:1 ratio. In other languages it’s easier to communicate “why” you are doing something, while in APL it’s the “how” that’s easiest.
- celeduc 5y agoC isn't very readable either which is why commenting is encouraged. But the Obfuscated C Contest is a competition whereas APL is literally the punchline for illegibility.
- jodrellblank 5y agoAs I asked in another thread about APL readability few weeks ago[1], would you be surprised to learn this is valid Dyalog APL? result←findMax data max←0 :For i :In data :If i>max max←i :EndIf :EndFor result←max then findMax 5 1 2 3 5 6 3 1 6 Writing it more neatly as findMax←⌈/ isn't mandatory anymore than `reduce(max, numbers)` is mandatory in Python. [1] https://news.ycombinator.com/item?id=28092097 https://news.ycombinator.com/item?id=28092097
- JulianMorrison 5y agoIt's a language using a graphical alphabet of built-ins. When you know them, you know them. When you understand how their position on the line creates an algorithm, you can see the algorithm. And then it's read-write.