Clean code


I think clean code has always been important, after reading the article, I think it is even more important. After reading the following two articles, what I think I will start to do is to comment on my code in detail. I actually don’t like to comment on my own code for one reason, the language. I am an international student, and English is not my first language; I find it difficult for me to explain my code sometimes in English, but if I use my own country’s language, I believe I can. Comment on my code if necessary. I feel that I need to use a translator, which undoubtedly increases my workload. But I think it is very necessary now, especially when doing team projects, your comments can help your teammates better understand your code, and it is also convenient for them to write it. Second, commenting on your own code can make it easier to understand and use.

Having said what I would do, what I would not do is avoid overly complex control structures, which is what I came to after reading the second article. Complicated control interfaces will make the code more difficult to understand and more error-prone. This is something that needs to be avoided as much as possible. You need to make your code look simpler and flatter.

Link: I read the article recommended by canvas.

  • Read Ch. 1, Clean Code from Robert Martin’s book Clean Code: A Handbook of Agile Software Craftsmanship
    Martin, Robert C. Clean Code: A Handbook of Agile Software Craftsmanship. 1st edition, Pearson, 2008.
  • Read Ch. 3 Bad Code Smells from Martin Fowler’s book Refactoring: Improving the Design of Existing Code
    Fowler, Martin. Refactoring: Improving the Design of Existing Code. 2nd edition, Addison-Wesley Professional, 2018.
Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *