As a beginner to intermediate programmer, I don’t overthink my code before writing it. Here is why.
I maintain this view as a beginner to intermediate programmer. Senior programmers, or programmers that are more gifted, are more in shape to design a solid code architecture before they proceed with any line of code, due to their sheer experience or talent. I am writing this for us average programmers.
I really believe that getting a minimum viable piece of code working quickly, despite being ridden with some flaws, is invaluable and preferable to thoroughly planning your code structure at the outset. There is an immediate sense of gratification. You have built something, and there is motivation to push forward and refine your work.
My Experience With React Projects
When I first started learning React and the use of the
Create-React-App boilerplate, I used to research and ponder the best folder structure for my project.
Where should I put these components? Where should I put the style sheets? Do I have too many components in one file? etc.
I read medium articles, blogs on the official React site and watched youtube tutorials in the hope of finding the perfect project structure. I read in depth articles on how to apply clean code principles to the components in the React tree, how to better organize my Css code.
And mind you I learned a lot from all this research. However I am simply trying to argue that starting to code without having the perfect picture, design or plan of how your code should look is completely fine.
You will discover and absorb the necessary insights and understanding via trial and error along the way. You will get stuck on a piece of code for hours on end, incredibly frustrated. But once you overcome that hurdle, and you understand the code or design principle that should be implemented in that specific circumstance, you will truly gain a deep understanding of the subject matter.
That’s why I believe it is hard to come by deep insights when researching how code should be implemented before you try it in the first place. Suffering the failures of your code is crucial and should be welcomed with open arms. That is personally how I gain major strides as a coder.
Building quickly and refining my code a bit with each iteration has become my default approach whenever I set out to work on a personal project. And it will remain my approach until I am confident of my skills and knowledge. But who am I fooling. I have serious doubt that will ever happen in this modern fast paced, ever-evolving world of programming, with new language features, frameworks and tools constantly popping up.