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

Depends on the language I'd say, but overall, try to keep state in as few places as possible, and make it more obvious when it's being used. Modern example would be Rust defaulting to immutability for variables, and makes it very clear when you should expect that this variable actually carries state rather than just a value, by prefixing it with `mut `. Other languages might make it the other way around, making constants/read-only variables stick out, and defaulting to "hiding that they have state" basically.


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

Search: