Good names help make it easier to understand what the code is doing compared to using variables like a and b and method names like my_func1 but it doesn't explain things like "why you wrote the code", "how it's intended to be used", etc.
Some devs might end up with this idea that as long as they write clean beautiful verbose code, comments won't be needed.
I would have to disagree, intent and why' can be conveyed.
It requires extra thought tho, which is what the quote is trying to encourage.
It's not meant to be taken literally.
Take fx.
// I'm gonna assume this is the unix cat command maybe?// I have no idea what data is.. this could be anything.functioncat(data){...}// Gonna assume this returns a Cat embedded in the inputfunctiongetCat(from){...}// Gonna assume this generate's a new cat from the inputfunctiongenerateCat(from){...}// My comments make sense here btw. :)// Since i am actually commenting' on my' thoughts.// Not what is going on in the code.
The intent is conveyed using verbs and subjects.
This communicates the message or intent shorter, usually meaning better.
The subjects i should know what is based on context and documentation.
The quote "If I had more time, I would have written a shorter letter." - Someone
Fully encompasses the idea.
I'l flip through you article now, thank you for taking the time to write it. :)
// Edit, ps, worth noting, with types, the verbosity and intent here could be much improved.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good names help make it easier to understand what the code is doing compared to using variables like
a
andb
and method names likemy_func1
but it doesn't explain things like "why you wrote the code", "how it's intended to be used", etc.Some devs might end up with this idea that as long as they write clean beautiful verbose code, comments won't be needed.
I've written a post about comments to clarify my position on comments.
I would have to disagree, intent and why' can be conveyed.
It requires extra thought tho, which is what the quote is trying to encourage.
It's not meant to be taken literally.
Take fx.
The intent is conveyed using verbs and subjects.
This communicates the message or intent shorter, usually meaning better.
The subjects i should know what is based on context and documentation.
The quote "If I had more time, I would have written a shorter letter." - Someone
Fully encompasses the idea.
I'l flip through you article now, thank you for taking the time to write it. :)
// Edit, ps, worth noting, with types, the verbosity and intent here could be much improved.