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

Similar. I mostly design my code around something like pipe and lifetime. The longer something needs to live the closer it is to the start of the program. If I need to mutate it, I take care that the actual mutation happens in one place, so I can differentiate between read and write access. For anything else, I clone and I update. It may not be efficient and you need to track memory usage, but logic is way far simple.




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

Search: