Hey,
I'm in the process (after 4 years of BSc and 2 years of MSc in SE) to get serious about writing good, proper, clean code.<p>Colleagues have recommended Clean Code: A Handbook of Agile Software Craftsmanship and I'm very tempted to try James Koppel's coaching.<p>What books/resources/courses have really helped you to step up your code game?
After doing it for years, I've realized that clean code isn't really a good end goal, so I'm not sure if it "steps up your game"<p>That said, The Pragmatic Programmer is my favorite resource for it. <a href="https://refactoring.guru/" rel="nofollow">https://refactoring.guru/</a> is also a nice reference point, in an easy problem-solution format.
You can buy Clean Code and it's not going to hurt, but I increasingly believe the only way to "step up" is to write code, lots of it.<p>Things like Clean Code are a bit too dogmatic for my tastes now, there are some reasonable ideas there but it's tempting to apply them where they don't fit.<p>What helped me was starting my own large project [0] based off porting another codebase. I started with wanting to follow Clean Code practices to the letter but now, 2/3 years later and with the benefit of hindsight I'm increasingly moving away from a lot of the Clean Code 'rules' (short methods, etc).<p>But I also write other short lived projects which allow me to try different things out and learn from my mistakes. When you think how we learn as children a lot is based on making mistakes and I think that is what's missing from a lot of how programming is taught.<p>[0]: <a href="https://github.com/UglyToad/PdfPig" rel="nofollow">https://github.com/UglyToad/PdfPig</a>
Learning different paradigms has helped me write cleaner code.<p>Functional programming, with its functions without side effects, has taught me how to better isolate the functionality in OOP code.<p>Lisp with its "code is data, data is code" has taught me how to create data that can be used to generate the correct code that had lots of duplication.<p>Years of working on legacy code has taught me the difference between useful and confusing abstraction, and what kind of code is more maintenable.<p>As @UglyToad has exposed "write code, lots of it".
For good clean code, check out the Thorsten Ball books - Writing an Interpreter[0] / Compiler[1] in Go<p>[0] <a href="https://interpreterbook.com" rel="nofollow">https://interpreterbook.com</a>
[1] <a href="https://compilerbook.com" rel="nofollow">https://compilerbook.com</a><p>While the books are not strictly about clean code, there's definitely a focus on it within the books.
It is often easy to make code cleaner even in a corporate setting: improve/update comments, reformat, add keywords that clarify the intent (const, private, ...), add explicit checks at the beginning of functions instead of letting them fail later in their body, remove duplicate code, split functions.<p>If you do it in a separate change/commit, it should be welcome.<p>I am not talking of refactoring: that is a completely different story, and requires extensive testing, long reviews...
To make your code clean you have to maintain the readability of your code. You have to make sure there is no duplication, code smells and vulnerabilities in your code.
To maintain your code quality you have to do code review.
I use Codegrip <a href="https://www.codegrip.tech/" rel="nofollow">https://www.codegrip.tech/</a>
which makes code review easier and maintain the quality of your code.
Codegrip is the one-stop tool for all code quality measures. Codegrip helps you to build a powerful code. It is an automated code review tool where code undergoes various tests for bugs, code smells, vulnerabilities and scans it for any security issues. It is a code analysis tool that finds critical metrics like duplication percentage, suggestive error, error resolution time, and many more displayed for all types of code. CodeGrip makes sure that every software has excellent code quality.