The art of code

Hold your pitchforks and hear me out first…

Image for post
Image for post

Just reading the title of this article might have gotten your blood boiling but hold on to your pitchforks for a second and hear me out. A well-placed comment can be immensely useful but nothing clutters code more than frivolous comments. In some situations, I would venture far enough to say that comments can be a way to compensate for our failure to express ourselves in code. So writing a comment shouldn’t be a cause for celebration, but rather a moment to take pause and ask yourself if there is a better way to express yourself in code instead.

Clear and expressive code with a few comments is far superior to cluttered and complicated code with lots of comments. If you’ve made a mess, don’t spend time writing comments to explain the mess — instead spend time cleaning up the mess. If every time you write a comment you grimace and feel the failure in your ability of expression, it will eventually lead you to write code that is clean and articulate, making comments completely unnecessary. Every time you express yourself in code, give yourself a pat on the back. …

About

Tameem Iftikhar

Founder @ Ruksack || Developer. Entrepreneur. Tinkerer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store