DEV Community

Discussion on: Why Good Code Needs Comments

Collapse
 
aramrafeq profile image
aram

in my experience the shorter the code the harder it is to understand because as you said developers are problem solvers so when you find a unique way to solve an issue most of the time the solution would be short and fast especially when you solve an algorithm for example if i said write a code that sums numbers from 1 -> 1m most developers may write a loop but this problem can be solved with just one line with this equation and if i see something like this without a comment i would freak out.

Collapse
 
bernarddusablon profile image
Bernard Dusablon

Sometime fastest code wear strange habits. In such case i prefer writing 50 lines of comment, than rewriting the optimal code.