Eventually I just gave up. Look, I'm a game programmer. I code because it makes pretty colors move on my screen. I favor the fast over the correct, and I only do things "right" when my inner self remembers the pain of doing it wrong before; so I stick to simple behaviors separated, rip things out immediately if they start to be a headache, build one-off behaviors that aren't scalable, because damnit I don't have time to think about how to build this correctly. I want it to work so that I can use it and move on.
I started my path as an aspiring architect who would write pure, scalable, performant and dare I say beautiful code. My programs would hum like a fugue by Bach and my comments would hang off the page like sweet blackberry bunches, easy to pluck and digest. My hopes were so high for myself!
But today I burn a path to my goal without consideration to the debt or damage it deals, my heart without morals and my mind without regret. Each day I stray further from god. Yesterday I had to rip out a utility function that took an entity and type as its input and searched the hierarchy for a parent of that entity with that type to return it, so that I could message root level objects on collisions with their child objects. What a disgusting beast I had created! What have I become! But I soldier on, unhindered by my evils. I cast code beneath my feet and it crumbles instantly as I take each step closer to hell.
But my game is really fun to play! :D
I somewhat regret spending my time at companies that were ultimately shutdown or acquired and my code being unceremoniously thrown out, but that isn't really about the code but rather lifestyle/career choice of working for startups.
I don't think from a creative or learning perspective I regret any of the actual coding. Sure some of it wasn't great code but that was generally a product of circumstances, generally the value I personally derived from the code was solid.
I did made an explicit career choice early on not to go into aviation/avionics because of it's dual-use. Originally being very interested in UAVs before they were cool I did built my own both fixed wing and quad-copter. After spending some time thinking about how my code would inevitably be used if I joined Boeing, Raytheon or Thales though I decided maybe something else would be better.
Throw people under the bus if necessary. Don’t accept ownership of code that sucks.