5 ms·
The article starts with some reasonable premises, but the conclusion does not follow. I think most APL programmers would disagree with this take. Dense code ha
by gilch 4y ago
The article starts with some reasonable premises, but the conclusion does not follow.
I think most APL programmers would disagree with this take. Dense code has real advantages, and naming everything has real costs that are hard to see. There's nothing magic about a "line" that suddenly allows for chunking. You have to build a parse tree in your head in any case.
I'm reminded of Doug McIlroy's challenge to Knuth.[1] It's worth a read.
Would you rather have 6 lines of dense shell, or 10 pages of Fabergé egg? I'll take the shell, thanks.
Look at the source code for J (an APL derivative)[2]. It's written in C, but that C was written in APL style by APL programmers. Lines leverage macros and 1–2 character names, making them extremely dense. Some files have a comment on nearly every line. For an average C programmer, this code looks absolutely insane. But it's not. The J devs find this perfectly readable and maintainable. It's clean code! If written with the typical C idioms, it could easily be 10x as long, and therefore harder to maintain. Your first impression is a snap judgement due to a difference of culture. You can learn to read this style with practice. Whatever your current style, that took practice too.
[1]: http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/ http://www.leancrew.com/all-this/2011/12/more-shell-less-egg...
[2]: https://github.com/jsoftware/jsource https://github.com/jsoftware/jsource
- overgard 4y agoI think the comparative rarity of APL compared to every other programming language in existence says a lot. Even if I were an expert in APL, I can't think of a single place where I could get a job writing it.
- gilch 4y agoI think language popularity in industry mostly comes down to path dependence[1]. It doesn't say as much as you seem to think. A few approaches got lucky in the rapid inflationary period of the personal computer revolution (C), and the advent of the Web (Javascript), and became deeply entrenched in industry, while superior alternatives that had been known for decades missed the boat. Industry languages still haven't caught up to where Lisp, Prolog, Smalltalk, and APL were in the 1970's, but they are clearly (if slowly) trending in that direction. APL and derivatives are still used extensively in finance, a highly competitive field, to say the least. That's where you find the jobs. [1]: https://en.wikipedia.org/wiki/Path_dependence https://en.wikipedia.org/wiki/Path_dependence
- ParetoOptimal 4y ago> I think the comparative rarity of APL compared to every other programming language in existence says a lot That's just the whole "popularity means it must be good" argument, which I disagree with.
- overgard 4y agoI'm not saying popularity = good, what I'm saying is that most people aren't smart or patient enough to use something like APL. Most people have a limit to the amount of density they're willing to deal with.
- ParetoOptimal 4y ago> Most people have a limit to the amount of density they're willing to deal with. Why? I believe if you started teaching someone APL who'd never programmed before you'd never hear "this code is too dense!".
- overgard 4y agoWell, I can only hypothesize, but APL is a lot like math, visually anyway. Most people are very intimidated by math. Math tends to be written for subject matter experts. If I'm reading a paper about graphics, I know that θ is "theta" and likely means "angle in radians". If I'm not a subject matter expert, it means nothing. Of course they can write at the top "let θ = light incident angle in radians", but I still need to hold that definition in my head while I'm trying to understand the rest of it. If I simultaneously need to remember ⍵ and ε and Δ, well, I can do that if I've seen those symbols used in similar ways previously, but it's certainly going to increase the amount of things I need to hold in my head if it's something novel. And now I have to memorize what those things mean, and I suck at memorizing personally. In contrast, most mainstream programming languages you'd just write "angle_rads" or some variant. It's a little longer, but I don't need to remember nearly as much because it's just plain english formatted in a way that at least resembles sentences I might read. I just think APL is too unfamiliar for it to be easy to learn, and so the only people that are going to learn it are those that are very intellectually curious. That's a good thing, but if you're talking popularity? Well, I think we've seen it, and it's not just path dependence.