(reposted from a Twitter thread hence the weird paragraphing)
Idk enough about gamedev (barely anything really) or about Love2D/Lua to judge but I'm guessing this might just be super quick because runtimes are usually super good at optimizing those kinds of codepaths anyway so like, who cares. If it runs good and fast, just do that.
Like, there's code like that in all the apps you use, I guarantee you. You just never see it. But something that 'looks' stupid but is easily readable/tweakable and happens to be fast reigns supreme over any "clever" bit of code.
But I also don't subscribe to the "haha fancy software degrees won't teach you this", it's true, they won't because they're usually teaching you a completely different facet of things. Writing code that needs to be used in a 24/7 service/software is different than writing a game.
If you need to worry about shit like user inputs, security vulnerabilities, etc then yeah suddenly you might need some abstractions and get more complex with it. But for a game, especially if you're the only dev on it? Do what you gotta do.
i wont comment on the relevancy of schools/degrees for gamedev specifically bc it's not my wheelhouse. but i know most of the schools my peers would go to are basically "make you ready to work at " degrees, where those things are normalized and the norm.
that said i am also a very bad example because I specifically told one of those schools "actually, i won't be there in September" to get my current job because what I had was good enough lmao
but that was also a luck of the draw type thing, i was barely decent at JS 'real programmer' type shit but i was pretty good at HTML/CSS so I had to learn a lot on the job. not every job allows that and it feels like those are getting rarer
anyway i got sidetracked but my point was that, after a certain point, Code that works and is simple to read/iterate with reigns supreme over clever abstractions that need to be tweaked every time a requirement changes.
I feel like "easily tweakable/modifiable" is really under-appreciated as a factor in writing code. There's a lot of programming information that kind of considers the code in a vacuum, but rarely consider other things like:
- If someone looks at this code, how easy would it be for them to understand what's happening?
- If I need to make a change, would it be easier if I isolated this specific logic in one place, or does it make more sense to abstract it away so it can change every time?
- If I'm submitting this for code review, will the generated diff be easy for someone to understand and interpret?


