3 ms·
Maybe the introductory text primed me to expect much worse, but I actually found the code quite readable although definitely underabstracted. I was expecting th
by userbinator 9y ago
Maybe the introductory text primed me to expect much worse, but I actually found the code quite readable although definitely underabstracted. I was expecting the opposite, the sort of code I usually see from beginning Java programmers: classes and methods everywhere, but almost no real work.
A long time ago, I (briefly) worked with Enterprise Java. The things I saw were far worse than this. 100+ deep callstacks[1]. Dozens of layers upon layers of do-nothing indirection. Dependency inversion and injection used for just about everything. 50+ character-long identifiers. Tons of XML-based configuration. The majority of the code consisted of nothing but methods that only called other methods, perhaps with a trivial conversion or reordering of the arguments.
This is perhaps an excellent example of how severe underabstraction is much better than severe overabstraction. There's very long sections of code here and some of it's very verbose, but it's all very concrete and just about every line is actually "doing something": the ratio of "actual computation" to fluff is very high. If given the choice, I'd much prefer working with a codebase like this than a lot of the Java/C# stuff out there.
I also echo the sentiment from others that the author is clearly very talented and dedicated, and deserves much praise for even attempting to write something like this and getting so far with it.
[1] Not mine, but for an example of this insanity: https://ptrthomas.wordpress.com/2006/06/06/java-call-stack-from-http-upto-jdbc-as-a-picture/ https://ptrthomas.wordpress.com/2006/06/06/java-call-stack-f...
- bendbro 9y agoI wholeheartedly agree. I've been trying to work that kind of coding style into my job, but it is difficult to do so without feeling embarrassed. My team also tends to jump on me when I try
- sytringy05 9y agomost stuff I look it is 95% boilerplate. At least this code does something :P @Author - Must admit although I'm glad there was a 3d array, I'm a little disappointed there were no object arrays. good job for getting it working, even though it was probably should have been put to bed...
- c3534l 9y agoI love me some good abstractions. But abstractions don't automatically make code more readable or efficient. They're overhead that shows their worth through volume and use. I follow the rule that you never abstract based on one instance, or even two. Show me three places you know this will be used, then if we know how it's going to be used we can figure out the best way to generalize that functionality.
- speedplane 9y agoThe worst is when the abstraction is designed prematurely for some limited use case, and then when you want to expand on it, you're stuck in some rigid format and have to either hack at it or rebuild the entire abstraction. This is a major reason why I no longer like OOP (I used to be religiously wed to it). Lightweight functions in modules, with structures that basically just hold data can be cleaner and far more flexible than a big object.