When I just started to read about programming and similar stuff, I usually thought that I will write the most fluent, easy-to-read, structurally right code. Moreover, I read as much various articles and tutorials how to do that properly, but the truth was different.
After a while I understood that the most important thing is practice, practice and one more time practice. You can easily learn syntax, best practices, but it is quite hard to adapt them on real life basis. For example, imagine yourself as a beginner PHP programmer who has to create easy to expand CMS. If it is your first project, you will get deep into the thinking of files tree, classes and other similar things. However, you will still write a bad code and that’s just fact which you need to accept.