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

One of my personal rules is to ALWAYS suffix the variables and fields with unit names:

`timeout_ms` or `rate_kbps`, NOT `timeout` or `rate`.

Unless the variable type already constrains it (e.g. Duration in Go).



Until someone comes along and changes it without updating the name, or the value comes from a remote service and they change without you changing your name… etc.


This also helps downstream a lot.




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

Search: