Developers: Stop Writing These Comments!

Developers: Stop Writing These Comments!

Write short and clear comments: developers do not want to read books in the codebase. Explain the why, not the what: if the code is readable, the “what” should generally be self-explanatory. The “why” can only be guessed or assumed by developers. Developers should know never to assume or guess! Developers: Stop Writing These Comments!

Are you really making useful comments in the codebase? Let’s find out.

There is technically no right or wrong when it comes to comments, but comments can have a big impact on efficiency. They can make developers’ lives much easier. Let’s take a look at some day-to-day comments and see how we can improve them.

Example Comments

Let’s go through some example comments and see how these are performing. Afterward, we can define some rules to make comments more efficient and useful for developers.

Example #1: The “what” comment

Have a look at the following example, and make up your mind regarding this commenting style.

// Find all the users
let users = userHelper.findAll();

// Add score to each user
users.forEach((user) => {
    user.score++;
}

// Return the users
return users;

programming javascript development

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Hire Dedicated JavaScript Developers -Hire JavaScript Developers

Hire dedicated JavaScript Developers who are proficient in AngularJS, ReactJS, NodeJS, & VueJS frameworks. Get flexible hiring models as per your business requirements.

JS Development Company India | JavaScript Development Services

Best JavaScript web app development company in India, PixelCrayons provides full stack JS development & maintenance. 16+ Yrs Exp., 60% less cost, Strict NDA

Hire Best JavaScript Developers | JavaScript development company USA

Hire Dedicated JavaScript Developers from a top javascript development agency for your business solutions. We provide JS web developers for hire at a fixed or hourly rate.

Learning JavaScript: Development Environments for JavaScript Programming

One of the nice things about learning JavaScript these days is that there is a plethora of choices for writing and running JavaScript code. In this article, I’m going to describe a few of these environments and show you the environment I’ll be using in this series of articles.

JavaScript Web Developer Bootcamp - Complete Guide to Become JavaScript Developer

In this Video we will learn these concept and there are almost 10+ Project in javaScript. One Video For becoming web developer. This video will teach you web development from scratch.