News for hackers. Stuff that matters.
Re:Should I Comment My Code? The Case Against Code Comments by Walkman on Thursday October 06, 2016 @08:56AM (#12652007)
I really like the way Robert 'UncleBob' Martin put it: "Every comment you write is a failure to express yourself well in code."
Re:Should I Comment My Code? The Case Against Code Comments by NateDad on Thursday October 06, 2016 @12:14PM (#12653672)
How are you going to express these in code:

"We have to trim the last character because this third party library we're calling has a bug that doesn't handle null terminators"?

Or "we have to continue to support the old-style url for backwards compatibility reasons"

or "we're dropping down to assembly here because it's 100x as fast as the naive solution"

or even "This function ensures the returned string ends in a line return."

Re:Should I Comment My Code? The Case Against Code Comments by Walkman on Thursday October 06, 2016 @12:41PM (#12653875)
First three are "why comments" so they are good. The fourth is not a comment. It should be clear from the code what it does.
Re:Should I Comment My Code? The Case Against Code Comments by NateDad on Thursday October 06, 2016 @02:20PM (#12654752)
You shouldn't need to look at the implementation of a function to know it's basic functionality.
Re:Should I Comment My Code? The Case Against Code Comments by Walkman on Saturday October 08, 2016 @07:04AM (#12666499)
So name your function "ensure_line_return"!
Re:Should I Comment My Code? The Case Against Code Comments by jordanhudgens on Thursday October 06, 2016 @09:09AM (#12652094)
Same here, I'll update the article and add that in, thanks for sharing!