While APL-styled C may be one extreme, I've noticed that average code has taken an uncomfortable shift in the other direction especially within the past decade, and I find it irritating to work with a lot of the "modern" stuff as it's far too verbose and needlessly indirect. I suspect the rise of strongly lowest-common-denominator lame coding standards and the desire by corporations to make programmers easily replaceable dunces is to blame for that insipidness.<p>(Aside: odd domain names like the one in this article I normally ignore in search results since they're usually full of SEO'd spam, but if one makes it to HN it's usually worth a look.)
I made some ~25 changes to the code[0], to show how some making some pretty minor changes can really improve readability, while still staying extremely tight. I don't need everything spelled out for me, and in fact I prefer a horizontal style--I hate scrolling too. But Arthur Whitney's code is deliberately obfuscating and IMO it tarnishes the positive aspects of the style.<p>[0] <a href="https://github.com/saulpw/ksimple/commits/main/a.c">https://github.com/saulpw/ksimple/commits/main/a.c</a>
Here's an attempt to make the code in the first link [1] slightly more readable by replacing the most frequently occurring identifiers with visually distinctive Unicode characters :)<p><a href="https://i.imgur.com/F27ZNfk.png" rel="nofollow">https://i.imgur.com/F27ZNfk.png</a><p>At least it's now much easier to spot multiple occurrences of the same identifier. All these unicode characters are still valid in C identifiers, by the way.[2]<p>[1] <a href="https://www.jsoftware.com/ioj/iojATW.htm" rel="nofollow">https://www.jsoftware.com/ioj/iojATW.htm</a><p>[2] I say 'still' because C23 is set to follow C++ and take them all away by restricting identifiers to XID_Start/XID_Continue. I find the whole XID_Start/XID_Continue idea unmotivated, both philosophically speaking and from a practical point of view, but what can I do. I just hope languages like Julia, Swift, Racket, and Clojure don't follow this trend anytime soon...
While the code may be elegant like the author suggests - I have never understood the coding style of <i>not</i> using descriptive variable and function names?<p>Is there any benefit that can't be gained from using a minifier or transpiler?
Is there a way to read this style of C, without prior knowledge of APL, J, or K? Can people with prior knowledge read this more easily? I'm asking this because this is the first time I took the time to read that `j.c` and it wasn't really any more readable than normal C code. I was expecting to "read the C source in chunks" but that didn't really happen.