3 ms·
In my opinion the single best way to learn to write better code is to read a lot of it. By reading you'll learn things from those with experience and with good
by lazypenguin 6y ago
In my opinion the single best way to learn to write better code is to read a lot of it. By reading you'll learn things from those with experience and with good practices. Most importantly, by reading code you'll find that certain practices make code harder to read and as a consequence you will develop a taste for good code while cursing any "bad" code you come across. Ultimately it's all subjective but in the end, I find that reading code in unfamiliar codebases as a powerful self-improvement tool.
- apabepa 6y agoAnother way to do it is to fix bugs and refactor old not so good code. Force yourself to understand the actual underlying logic and the problems it solve. Use your frustration to figure out a better design that code so it wont punish future programmers.. After doing this for years you will hopefully have built a good habit of simple and clean design.