Tired of having to write comments in your code? Well stop doing it, write self-documenting code instead.
There is an age-old discussion about adding comments to code, one says you must, the other says only sometimes, but generally it is accepted you should add comments to your code to make it proper readable code.
I’m here to tell you that is wrong.
Instead, your code should be self-documenting. This is also a topic I discussed in my recent post about improving your JavaScript functions.
5 ways to improve your Functions in JavaScript
But let’s dive into it a bit further.
First off? What is self-documenting code?
Self-documenting code, as the name implies, documents itself. This doesn’t mean you can easily generate documentation from it, but instead makes your code so readable you don’t need documentation or comments.
#web-development #javascript #programming #software-development