Considering last year was six days ago.....I agree.
Writing really good comments is an under-appreciated skill.
Even though comments are very helpful, often it's even enough to name variables and methods/functions really good. At least do that. You don't want i, j and value. Believe me. You want rowCount, colCount and deliveryOption instead. You just may not know it now, but you will, when it has to be changed in a few months.
Comments are good when you're doing something weird to handle an edge case or something. But yeah most of the time clear variable names, and extracting complicated code to a dedicated and clearly named function, are enough.
There are only two hard things in Computer Science: cache invalidation and naming things.
Phil Karlton
Where comments are useful most is in explaining why the implementation is as it is. Otherwise smart ass (your future self) will come along, rewrite it just to realize there was indeed a reason for the former implementation.
// don't know anymore, just leave this block alone
I was once like "🤨... what drugs was I on when I wrote this 🤨". Comments didn't help, I must've been under the influence of something, it didn't make any sense.
The weird thing is, it works 😂.
You gotta comment what drugs you were on when you wrote the code
Darn, forgot to do that.
This is me with code I write now
The script i wrote last month. I have to redo it!
Many years ago I wrote some puny lines that randomly and repeatedly inserted the word "documentation" as comments into code. I stumbled upon one of those abominations shortly before Christmas, I laughed so hard as I remembered. I couldn't explain to anybody why, though.
Well you can‘t say that you didn‘t write „documentation“.
Whos the fucking idiot that wro.. oh it was me.
Considering last year was six days ago.....I agree.
Writing really good comments is an under-appreciated skill.
Even though comments are very helpful, often it's even enough to name variables and methods/functions really good. At least do that. You don't want i, j and value. Believe me. You want rowCount, colCount and deliveryOption instead. You just may not know it now, but you will, when it has to be changed in a few months.
Comments are good when you're doing something weird to handle an edge case or something. But yeah most of the time clear variable names, and extracting complicated code to a dedicated and clearly named function, are enough.
Phil Karlton
Where comments are useful most is in explaining why the implementation is as it is. Otherwise smart ass (your future self) will come along, rewrite it just to realize there was indeed a reason for the former implementation.
I was once like "🤨... what drugs was I on when I wrote this 🤨". Comments didn't help, I must've been under the influence of something, it didn't make any sense.
The weird thing is, it works 😂.
You gotta comment what drugs you were on when you wrote the code
Darn, forgot to do that.
This is me with code I write now
The script i wrote last month. I have to redo it!
Many years ago I wrote some puny lines that randomly and repeatedly inserted the word "documentation" as comments into code. I stumbled upon one of those abominations shortly before Christmas, I laughed so hard as I remembered. I couldn't explain to anybody why, though.
Well you can‘t say that you didn‘t write „documentation“.