Prompt: What is one thing from the articles that you would like to start doing (more often), and why? What is one thing you want to avoid doing and why?
One thing I aim to avoid is postponing the cleanup of my code. Often, I’ll reassure myself that I can tidy up my code later, which, while convenient at the moment, usually results in starting with messier code and facing a bigger cleanup task later. Robert Martin emphasizes in Clean Code: A Handbook of Agile Software Craftsmanship the “Total Cost of Owning a Mess,” detailing how initially messy code can lead to even more complications and significantly slow down productivity (Martin, 2008). By committing to writing clean code from the start, I hope to enhance my overall productivity and maintain my motivation to keep my code clean and free of smells.
On the flip side, I’d like to focus more on refactoring code. Martin Fowler describes clean code as “mundane and clear” (Fowler, 2018), which resonates with my view that code should be readable, straightforward, and unambiguous. Mastering refactoring, and recognizing when it’s necessary, is a skill I’m eager to hone. Fowler offers a great tip regarding code comments: “When you feel the need to write a comment, first try to refactor the code so that any comment becomes superfluous” (Fowler, 2018). This is a practice I plan to adopt more actively, as it not only improves code clarity but also helps in identifying and rectifying ‘code smells’ more effectively.
In other news, I’d like to share my own experience identifying code smells and refactoring code. Last term, I took CS 464 Open Source Software, where I got to dive into identifying code smells and applying my refactoring skills by identifying an issue and creating a pull request for an OS project. Here is a link to my PR: https://github.com/GenderMagProject/GenderMagRecordersAssistant/pull/166.
References:
Martin, Robert C. Clean Code: A Handbook of Agile Software Craftsmanship. 1st edition, Pearson, 2008.
Fowler, Martin. Refactoring: Improving the Design of Existing Code. 2nd edition, Addison-Wesley Professional, 2018.