I have worked for 4 companies so far, and I worked on some projects on my own.
So far, I was able to see that coding is the least problem. Major problem with software are related to poor management i.e. lack of planning.
It is generally accepted that you cannot collect good specs, that user will change his mind in the middle of the project, that some initial design decisions will prove to be bad ones etc. But that is not an excuse for good ol' planning.
As a first, you have to decide what features you want to implement. But I have heard zillion of excuses just to avoid to make a list to start with. Because, if you make a list, then you are responsible for the list, and then someone can ask you about the list. So the solution is not to make a list.
Without feature list, there could be no good and precise architecture. And good architecture is significantly more important than good code.
Finally, once you have to make changes, noone will let you to do refactoring. It is impossible to make any significant changes if you don't change architecture. But refactoring is never calculated and financed. So you get bad product even it had a decent architecture in version 1.0.
Testing is first thing that is reduced if deadlines is approaching. Testers are not paid enough. Often they don't even exist, and programmers are notoriously bad in testing it's own code.
Programming is like shooting a moving target. But it does not mean that you can shoot randomly. Moving target means that you have to shoot more cleverly.