Differences

This shows you the differences between two versions of the page.

Link to this comparison view

blog:2021:08:30:2021-08-30_-_on_code_comments [2021/08/30 09:09] (current)
basz created
Line 1: Line 1:
 +====== 2021-08-30 - on code comments ======
  
 +recently, while [[https://​lexfridman.com/​brian-kernighan/​|listening to a podcast interview]] with [[wp>​Brian Kernighan]] i came across of a great quote from him:
 +
 +> Don't comment bad code -- rewrite it.
 +
 +while i did [[blog:​2020:​01:​11:​2020-01-11_-_self-documenting_code|mumble about code comments in the past]], this quote is so good and adequate, yet so condensed, it's worth exploring it a bit:
 +
 +  * bad code shall not be commented, but rewritten.
 +  * existing comment may hint you that it might be a bad code.
 +  * comment does not necessary mean that the code is bad.
 +  * there are places where comments are needed, as it's hard/​impossible to explain it enough in code.
 +
 +another quite from Brian K. that i love is:
 +
 +> Do what you think is interesting,​ do something that you think is fun and worthwhile, because otherwise you won't do it well anyway.
 +
 +here are [[http://​ellard.org/​dan/​www/​libsq/​ref/​style.html|some]] [[https://​www.goodreads.com/​author/​quotes/​153350.Brian_W_Kernighan|more]]. :)
 +
 +and remember -- by the end of the day, there are only 2, truly difficult issues in IT:
 +
 +  - cache invalidation
 +  - naming things
 +  - off-by-one errors
blog/2021/08/30/2021-08-30_-_on_code_comments.txt ยท Last modified: 2021/08/30 09:09 by basz
Back to top
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0