An example of bad coding is Amazon’s game, New World. They had lots of bugs, and when they tried to fix some bugs they broke other stuff that they weren’t even trying to change and didn’t know would change because it seemed unrelated.
To get to this ideal state where almost none of one’s ideas have known flaws, it’s important to organize one’s ideas into small modular chunks with well-defined interfaces between them. This way, when an error occurs, it’s clear where the error is and what other ideas it affects, and it’s usually easier to fix the error. Just like in programming.