by raverbashing · 4y ago · 0 comments
Yeah that sounds like the easiest way to make your colleagues hate you
I "love" how we had more languages in the 70s (usually created as a one-off project for people with not so much user friendliness in mind) think m4, awk, tcl, etc
Some absolute lunatic solved this year's Advent of Code in m4; it was impressive.
Except C.
(It was a long time ago, and there was no C compiler on our IBM/370...)
For short scripts, awk is nice, but most people would use Python nowadays, and die hard Unix greybeards will use Perl or TCL depending on the mood.
Well I'm not Whitney's colleague but I really like his code.
I like it because it makes it easier for me to see the big picture. The forest and the mountain. It doesn't over-emphasize the bark on the trees; it doesn't drag on and make me scroll & jump through a maze of boring minute detail. At the same time, it doesn't actually bury and hide whatever detail there is; it's all there for when you need it. Whitney also generally simplifies things a lot and avoids tedious contortions others would make for portability or some theoretical conception of maintainability, readability, or vague "best practices". It's very straightforward and -- once you get past the Whitney vocabulary and general style -- there are no mountains of abstractions and layers you need to grok before you can work on the code.
The biggest problem is that after getting used to that style, "normal" code starts to feel like kindergarten books with very simple sentences written in horse sized capital letters, a handful per page. Except that those letters are not used to write a short children's story, but a complex labyrinthine machine, and the over-emphasis on minute detail just obscures the complexity and you end up with cross cutting concerns spread over thousands of lines of code and many many files. It might look clean and readable on the surface, yet: there be dragons. And nobody wants to tame those dragons because there's so much code. And then I find myself sighing and asking: why on earth do we need an entire page for what would really amount to a line of code if we didn't insist on spelling everything out like it's babby's third program after hello world? It's just tedious.
Whitney certainly writes his own sort of dragons, but it's easier to keep them all in your head. For example, the b compiler won't work out of the box on multiple platforms. I'm fairly confident I could port it without much effort, as long as the platform meets some basic requirements.
> Learn to read and it turns out not to be unreadable?
There's the thing, if someone learns Russian they can converse with 140 million people in Russia, similarly Ukrainians and Belarusians will be fine and they could probably make themselves understood through the Caucasus and Central Asia. If you learn to read C written in the Arthur Whitney style you can "converse" with a fairly small number of people who like the Whitney style[1]. So taking the example a bit further, I learned the Cyrillic alphabet in an afternoon and through knowing another Slavic language I can roughly parse the meaning of many Russian things I read (audio is another thing entirely, I can only pick out a handful of Czech/Russian homophones). If I had gotten up to speed with the ngn/k codebase would I be productive on one of the projects you wrote in a similar style, or is there a similar productivity wall where I'd have to first learn some idioms local to your codebase?
Sorry for the questions, I know people who like this style probably have to answer these questions fairly frequently. I am genuinely just quite curious though.
[0] = https://codeberg.org/ngn/k/src/branch/master/h.c
[1] = is there a proper name for this or is it ok to refer to it as "Whitney style"?