Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Tell HN: Deciding between singular and plural variable names
1 point by bkyan on Aug 17, 2012 | hide | past | favorite
Since I code in english, a language that forces you to make a distinction between singular and plural forms, my variable names have to either be singular or plural. This sucks, because being variables, my singular variables could end up holding plural content and my plural variables could end up holding singular content. My idea to deal with this annoyance is to append "set" to my variables. For instance, instead of choosing between $hash and $hashes, I just name my variable $hashset, which "feels right" for both singular and plural content.


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

Search: