About half of my week is spend troubleshooting old legacy code for this or that industrial automation devices and PLCs, the latter being their own animal driven by ladder logic. Regardless if it's some firmware in C, some proprietary app pounded out in some ancient .NET version or just plane old PLC programming, the amount of times I have puzzled over what the heck the original programmer was thinking is mind blowing. Prior to moving into this position, I had no idea what the crufty greybeards meant when they were griping about spaghetti code. Now I do. Stepping back through someone else's work, often done with some kind of set-it-forget-it mindset because, for some reason, people create things and ignore that the environment will eventually change, is the biggest, dumbest headache. So dumb, that about a year ago, I start practicing things like writing firmware from scratch because just starting from zero turned out to be easier than trying to fix someone's old, convoluted mess.
Most humans code crap. Some humans code very, very well and write beautiful, eloquent software as a result. Congrats to those in that crowd, but understand they are the minority. So, when we started feeding a stochastic parrot some code to teach it to do our work for use, we fed it garbage. And what happens when garbage goes in?