I'm going to avoid calling out individuals, since these are personal viewpoints.
I don't like doing it either, since behind each "bad" code, there's someone who at least tried. But for once I'll make an exception, the reason for this will be self-explanatory once you'll be done reading :
Dreaming of Dana.
Among the other things, when you look at this game, you'll see this :
Code:
default Danavar1 = False
[...]
default Danavar100 = False
default Danastvar1 = 0 # bad marks with dana
[...]
default Danastvar10 = 0
By itself, the presence of 100 flags and 10 variables for a single character, isn't necessarily bad. No, the problem here, is their anonymity.
You'll use one to store the result of a decision made by the player in the update 3. Then, you'll have to refer to this decision in the update 6, so generally three months later. I'm sure that few would remember that the variable used at this time was
Danavar14
.
Therefore, either you were provident and have some references notes somew... oh ! no, you weren't. If you understood from the start that this anonymity would be a problem, you wouldn't have used it. Well, you now have to browse your code, in search of the part where the decision was made, to find which flag was used to store its result.
And you'll have to do this every single time you need to refer to a previously used flag. Can you imagine the time lost because of this ? Ten minutes past searching a variable name, each time you need it. How many days does it make when the game is finally finished ?
Because the game was finished, it was even a hit at its time. Ptolemy even started other games, he stopped neither his game, nor his career. Simply because having a "bad" code don't prevent the result to be good and interesting, and it don't prevent the author to go to the end of his project, nor to start a new one.
But it still do something ; what was initially a pleasure, slowly transform into a burden. In this particular case, the game slowly shifted from an interactive story, to a pure kinetic novel. And it's not a too wild guess to say that it's surely linked to this "bad" codding.
In this kind of case, there's always a time when you reach a point where you only have two choice. Either you quit making a game, or you quit your initial idea and go to something as simple as possible. Some devs, that I'll not name, have made a specialty to choose a third way, restarting from crash... It can works only if they learned from their errors.
By itself, a bad code isn't necessarily a problem for the game itself. There some in this case, but they stay an invisible minority. No, it's a problem for the author itself, it make his task way harder, and make him lost more time that the time he would have past to learn the basis.
There another example, that I'll not name partly because I don't remember the name. And this one is real bad codding. The author had near to 100 screens, all having two/three lines, all displayed by groups. Each time he had to show a stats screen, he had to show near to 10 screens, and to hide all the others, just in case.
To this, he added an misunderstanding of how
scene
works, hiding the previous image before showing the next one.
He'd quit long ago, after the second update of his game, and it's understandable. I made the count once, and it was so amazing that I'll probably never totally forgot it... Among the 10000ish lines of his code, only 2000ish was necessary. Can you imagine that ? 80% of the code was useless lines.
80%... This is the price of his bad code, the price that he had to pay. For every needed line, there were four useless ones. And because of the way he worked with the screens, in this particular case it was more like : every now and then, he had to repeat a hundred lines that could have been just one single line.
His code was the bad of the bad. He could have used a called label for the "hide all screens" part, one for the "show all those screens that could have been one". But no, he copy/pasted them, which mean that he first had to find the right combination of lines.
Even if you make your game by passion, how can someone not quit in this conditions ? "Ok, now I need to show this screens combination... Ah, fuck, it mean that I'll have again to write all those lines... Where was the last time I needed this particular screens combination ? Well, I'll search."
It consume your passion at first, then start to consume you...
There's code that make me frown, or make my eyes bleed, but mostly it's my problem. The example you gave, are part of this. It's "bad", but except the check before assignation, it don't really change the life of the author.
And there's the code that make me cry out of empathy. I look at it, and I wonder how the person who write this can not want to hang himself. Not because his code is bad, but because it's such a burden to deal with it, to maintain it.
Writing a game as indie dev should be a pleasure and only a pleasure. There's day where you have to force yourself, but when come the day to release the update, you should thing, "yes ! I made it", not, "at least I made it". And for this, the code you write should be "not this much bad".