DEV Community

Discussion on: State-of-the-Art Shitcode Principles

Collapse
 
ghost profile image
Ghost • Edited

Fun post but

💩 Never write comments

const cdr = 700;
// Callback function debounce rate in milliseconds.
const callbackDebounceRate = 700;

I would say that changing the variable name was enough, I think that the comment is redundant :D, if the fact that is in ms is not obvious I would put it in the variable name. For the example I would put something in the lines of

// In milliseconds because some reason or 700 calculate empirically, some 'why'
// not some 'what'. If the 'what' is not clear in the code, the code is probably
// too messy.
Collapse
 
trekhleb profile image
Oleksii Trekhleb

This is a very good point about the comments. I've updated the main list. Thanks!