Hello Debug Ducker here, and today this piece will be a bit different. I want to share my opinions and others about on a somewhat controversial figure in the coding community. Robert Cecil Martin also known as Uncle Bob is a well-known software engineer. He is known for many things such as the subject to today’s topic, “Clean Code” a book written by him that discusses and shares what clean code is. it offers advice on how to structure and write code for it to be “clean”.
From my experience from reading excerpts from the book and trying some of his advice on an old project of mine, I have found that it has made the code a lot more readable. However there is some advice that I don’t agree with. To paraphrase, Uncle Bob mentions that a function should avoid having more than one argument or have none at all. He saw that the more arguments, the less clear it is. I understand what he means but personality I feel this may not apply to all cases when writing code, especially if you need multiple arguments to achieve something, so the advice is situational. It made me curious to do a bit of research myself on what others may think of his advice, and I found an article that shares similar sentiments about the advice given by Uncle Bob.
The blog is from a username qntm, who is a novelist but also a programmer. The blog entry is called “It’s probably time to stop recommending Clean Code”, and as the name may suggest, is an opinionated piece on the book of the same name by Uncle Bob. The blog entry had critiques about the book, such as the advice from Uncle Bob that said functions should only be about 3–4 lines. The user qntm found this bizarre, and frankly, I did too as I find this very restrictive for making functions.
That is just one of the many examples from the blog entry, and I would advise you to check the blog yourself to read the full thing. I’ll provide a link below and perhaps search for his other entries as well. I wanted to show you this because the definition of clean code perhaps can’t be defined by one person. Though I have found some of Uncle Bob advice to be helpful, I don’t think all of it should be taken as gospel. Apply his teachings where it may help and perhaps consider finding other ideas of clean code elsewhere because Robert is just one man who wanted to share some advice, I am sure others have different ideas that may help you as well.
Here is the blog entry by qntm about the subject for those curious
It’s probably time to stop recommending Clean Code. Things Of Interest @ Things Of Interest. (2020, November 28). https://qntm.org/clean
Martin, R. C. (2016). Clean code Robert C. Martin. Addison-Wesley Professional.
From the blog Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.