Why I'm Not Fond of Comments
I value the importance of code quality a lot. I think that taking the time to look at your code and upgrade it is essential. It not only helps to make things better for you, but it allows you to spend much less time on your code than usual. From 29 days to 1 hour just by writing it correctly, isn’t that great?
The basics

Source : https://blog.mocoso.co.uk/posts/talks/take-control-of-code-quality/
When you want to write good code, you need to know the basic principles to follow. They are all simple mantras that you can apply in every situation. It will take you some time to get the hang of it. But once you get used to it, it will be natural and easy to use in every line of code you write.
Code Clarity
This principle is often the first to come to mind, because it is obvious : A code needs to be clear and readable, especially when you need to read it again later. It is essential to not fall for bad variables naming, useless for loops, functions with weird paramaters. It makes the process of reading the code and upgrading it harder for you, and even harder for someone else.
Code that is hard to understand
function calc(a, b) {
let s = 0;
for (let i = 0; i < a; i++) {
for (let j = 0; j < b; j++) {
s += i * j;
}
}
return s;
}
Here, we don’t understand what the function does; we don’t understand the goal.
The variables a and b are meaningless, and s has no indication of what it is supposed to represent.
The code lacks context, making its use ineffective. If someone has to debug this later,
they will be forced to go through several steps before truly understanding the purpose of the function.
In the end, this results in a waste of time.
⚠️ Reminder : Here, we are talking about code quality, not logic. We don’t care if it works or if it is optimized — we only care about the quality.
Clean code & well-structured
function calculateTotalAmount(numberOfProducts, pricePerProduct) {
let totalAmount = 0;
for (let i = 0; i < numberOfProducts; i++) {
totalAmount += pricePerProduct;
}
return totalAmount;
}
Here, the function name calculateTotalAmount clearly shows what it does.
The parameters numberOfProducts and pricePerProduct are explicit and
convey their meaning within the function. The variable totalAmount reflects
the purpose of the function, making the code much easier to read.
This kind of clarity saves you a lot of time overall and ensures good maintainability.