which consists of people looking at a screenshot of code that is straightforward and getting angry that it's not more complicated.
I'd just like to posit here that a straightforward solution is an excellent default and you should have a really solid argument for the advantages of a complicated solution before you choose it.
every time there's a "look at this gamedev code" post, it's usually from a cs graduate, often fresh.
for them, code is a means to demonstrate knowledge
they've never been tested on "making things maintainable" or "exploratory programming", but they have had to spend exam after exam writing code to show that they know fancy tricks. the idea that code can be boring is almost anathema.
this habit continues well into their career: you don't have to look further than a technical interview or code review to see more senior programmers setting up elaborate games to show how clever they are.
that's why when they bump up against gamedev code, be it 5000 if statements, or three state machines lovely crafted into a powerset to handle events, it just feels wrong. the code works, does what it needs to, but no-one gets to feel smart about it. what gives?
"i get it, you've only seen code in a textbook"
i promised myself i wouldn't talk about "the effectiveness of the code" but i have encounted two earnest replies talking about "just a little bit of cleanup" but both fail to understand that's how the code in question got that way
step one: hey, these business rules (game logic) are clunky to write, let's be more OOP about it
step two: ok it turns out even when you add objects and callbacks, 5000 rules still looks like shit, and being in c++ means it's hard to change our minds
step three: let's put these rules out into a DSL to handle it. let's not write our own DSL. let's use Lua, load it at runtime, and we can change things on the fly. the code's still a mess but it's very contained and the boilerplate is minimal
you are here. this is where you are, and yet some of you have the gall to suggest a step four
"what if we wrote something more oop" in lua that does not have objects or classes. "what if we put it in functions and a hash table" then rules that operate on more than one object become four times as cumbersome.
"what if" what if we didn't just blindly suggest things without taking one second to ask how they got that way.
