Comment by rramadass
3 years ago
I used to believe this but i don't anymore.
From https://github.com/tlack/b-decoded
Arthur is famous for his very dense programming style. Most C programmers would scream when seeing this code.
In his view (and others in the terse scene), it is much better to have everything in your application readable on the screen at once than to have great names for things or a lot of white space to comfort the first timer reader.
To them, once you've sufficiently studied that screen or two of code, you can understand all of it at the same time. If it's spread out over thousands of files, it's very difficult to understand all of it, which leads to bugs, unnecessary abstraction, and the need for advanced tooling just to work with your own project's code.
He wants to see the code "all at once" so he can understand all of its behavior without paging around and shifting his focus to another tab, window, etc. To get there he makes a lot of tradeoffs in terms of the code formatting and naming conventions. He also, in b, creates a dense set of interlocking macros and abstractions that can make the code very hard to follow.
Critics and the uninitiated say that his code is like old school modem line noise: random punctuation intermixed with bits of understandable code. I would suggest that he's actually quite careful with the abstractions he chooses and they are actually not always the most dense, highly compressed code structures available to him. He chooses wisely and his code rewards deep study.
Interview with Arthur Whitney: https://queue.acm.org/detail.cfm?id=1531242
I looked at the two-line code sample at the link, and it is extreme.
Yeah, Arthur Whitney's code is extreme (he is one of a kind) but the sentiment is something i wholeheartedly subscribe to.
The key point is this; once you've sufficiently studied that screen or two of code, you can understand all of it at the same time. If it's spread out over thousands of files, it's very difficult to understand all of it,
Because there are so many interlocking concepts in code you have to keep as much as possible in your head to build up the entire picture. This is where concise, terse and direct-to-the-point code shines; nothing gets in the way of putting all the pieces of the jigsaw puzzle in front of you so you can "get" everything at a glance. A good example is K&R C style espoused in their book which i used to find difficult in the beginning but now understand. Always put as much of relevant code as possible into one screenful.