Comments
Prefer self explanatory code instead of comments
// Check if subscription is active.
if (subscription.end_date > Date.now) {
/* ... */
}
const is_subscription_active = subscription.end_date > Date.now
if (is_subscription_active) {
/* ... */
}
Don’t leave commented out code in your codebase
do_stuff()
// doOtherStuff()
// doSomeMoreStuff()
// doSoMuchStuff()
do_stuff()
Don’t have journal comments
/**
* 2016-12-20: Removed monads, didn't understand them (RM)
* 2016-10-01: Improved using special monads (JP)
* 2016-02-03: Removed type-checking (LI)
* 2015-03-14: Added combine with type-checking (JR)
*/
function combine(a: number, b: number): number {
return a + b
}
function combine(a: number, b: number): number {
return a + b
}