2 ms·
Thanks, just spent some time browsing through that source. At first I was going to say it didn't look too bad, but then saw some comments from someone named Chr
by Trasmatta 6y ago
Thanks, just spent some time browsing through that source. At first I was going to say it didn't look too bad, but then saw some comments from someone named Chris Johnson that everything used to be contained in a single game.cpp file. The current state of the source honestly doesn't look too bad. Some large and scary case statements and functions, but that's not always a terrible idea in game dev, and it looks to be well commented. But I'm not sure how much of that is thanks to Tarn or other people that have cleaned up the source.
That being said, LCS came out in 2004, so presumably Tarn has improved over the years.
- genocidicbunny 6y agoFrom my understanding, Tarn first and foremost focuses on making the game fun (and Fun) rather than making the code well-organized and clean; I seem to recall some interview or maybe forum post where he made that clear. In practice that likely means that the code is not all that well organized and planned out. Doubly so if he and his brother have been the only ones who have touched it -- there's a lack of outside influence that would drive one to clean up their code. I of course have not seen any of the source code for DF, so I this is purely my own hypothesis.
- Trasmatta 6y agoYeah, agreed. The Dwarf Fortress code might look like a mess to an outsider, but the only thing that really matters is that it works for Tarn. A codebase that will likely only have one contributor ever doesn't need to be written to the same standard as codebases with many contributors. (I believe Tarn does all the programming and Zach does creative work / writing -- somebody correct me if I'm wrong.)
- flatline 6y agoAnd yet I have seen other code bases become true unmaintainable messes after so long a time, even by their creators. DF works remarkably well. I know he has gone through a few large refactorings in the past out of necessity. I doubt the code is pretty or easy to follow, but I also doubt it’s bad in many ways that code can be so.