3 ms·
Out of interest, why do you think the Handmade Hero code is atrocious? I haven't kept up with it so I don't have much of an opinion.
by ilek 11y ago
Out of interest, why do you think the Handmade Hero code is atrocious?
I haven't kept up with it so I don't have much of an opinion.
- gregstula 11y agoIt's gross because it's written in "C with namespaces and overloading" Preferring #define for constants over constexpr is 100% the result of C++ bigotry. It's a laughable decision. constexpr gives you the power of typesafe, compile time evaluation of purely functional expressions with type deduction. #define gives you a compile time 1972-style copy-paste
- ilek 11y agoI agree with things like these, I think Casey and other programmers like him are too far in the camp of C++ is just C with classes. From what I have seen of the code and videos, I think his general structure of programs is off. I'm no advocate of "every function has to be at max N lines" or "every file has to be smaller than N lines". But I think there are issues there, and I don't think it can be defended just because it's a game, where a lot of general practices go out the window.
- w0utert 11y agoListing all the things bad about it would take me the rest of the afternoon, and likely evoke many replies along the lines of "you don't understand why he does it that way, it's supposed to be handmade, so you can't have all the nice things", like last time I commented about the HH code. The executive summary would be that the code is basically full of unsafe code, pointer chasing, half-hearted argument/input validity checking, no memory management, no abstractions of the higher-level parts of the code, it uses none of the idioms we've learned through years of writing crap code to avoid common mistakes (RAII would be a good example, etc), doesn't use 99% of the language features C++ offers over C. Casey himself dismisses these things as adding unnecessary bloat and/or mental overhead, that they have no benefits for his purpose, and that the way he writes code you don't need them, but I just flat-out disagree with that. Let me make clear that I'm not saying this because I don't like HH or because there's nothing to be learned from it, just that the results you get from this programming style should not be taken as an example. The quality of the code is immediately apparent if you watch Casey work on it in the streams, almost every line he changes breaks something somewhere else in the code, often even multiple things.
- ilek 11y agoYeah from what I've seen I've noticed he jumps around a lot putting out fires when he changes anything. Like I said in another reply, he's too far in the camp of C++ being C with classes. I think the sad thing will be people are learning C/C++ from him and so will try and program anything in these languages like this.