Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah but I've also seen things like:

AddsFiveToNum(num) {

  return num - 5
}

A bunch too. So I don't think comments are solely at fault. Self documenting code is only as good as the person who wrote it, and the people who approved it. Sometimes a comment is warranted, sometimes it's not.



That one drives me nuts. A while back I changed some code that had a bool called “uninit” that when true, meant the value was initialized.


Yesterday I learned that in emacs lisp, "defvar" is a definition that is set one time only and from that point on can never be changed (i.e. can not be VARied) and "defconst" is a definition that can be changed (i.e. is not CONSTant). Naming things is hard.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: