Readable Code VS Code Comment

readable-codePersonally I would say that readable code and code comment goes hand in hand together to make simple code. However there are people who like to take them to the extremes. So…

Readable code is useful because:

  1. Using high level language, it is almost like reading a book.
  2. No need to write code comment because the code is clear.
  3. The code is self explanatory.

But:

  1. It is not always possible to write readable code. Try writing readable code is Assembly language.
  2. It requires consistency.

Code comment is useful because:

  1. It explains the logic behind the code
  2. It explains why a particular solution is chosen

But:

  1. Code comment takes up space in the code.
  2. Excessive comment can lead to the comment not being read and it blurs the code.

Now, I believe both have its advantage and disadvantage. They each have their own purpose.

So, they should be used together.

Remember that both are used to help developers understand the code.

What do you think ?