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 haven't looked at Balatro in particular yet, but 1000 times this.
all the big-O properties of algorithms you learn in college are irrelevant in the world of indie game development. unless you know you're doing a very specific computationally-ridiculous thing as your game's gimmick, your favorite data structure is the Vec/ArrayList. it's simple and it's cache-coherent and it lets you write the game part of the game.
"but I'm supposed to use a linked list if I'm making a lot of insertions and deletions" yeah buddy, enjoy all the allocs and frees that come with it. you'll know you need something different when it becomes an issue and you can replace it then.
refactor your code as you need to in order to stay motivated to keep working on it, but the best data structures and algorithms to use for a game are the ones that get it finished.
think of how many more copies Balatro would've sold if its code were more mathematically pure and elegant!
ALSO the balatro discourse in this case is foolish because 1) the discoursers treat a 4717 line long file as a big file. what a fucking joke. 2) there is a high chance this was tool generated: they probably defined the rules in a system better designed for it, and then used a series of tools to lay it down as if statements, a great practice 3) even if it wasn't, who fucking cares, mind your own fucking business 4) it's a fucking lua file, seriously, mind your own fucking business 5) it's their cost/benefit analysis to use this file as is, and they will benefit or pay for it as they will, you have no stake in this decision, so Mind. Your. Own. Fucking. Business.