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

> there's no good way to pass state between the seven functions unless you pass all the state you need,

That’s why it’s better than comments: because it gives you clarity on what part of the state each function reads or writes. If you have a big complex state and a 100 line operation that is entirely “set attribute c to d, set attribute x to off” then no, you don’t need to extract functions, but it’s possible that e.g this method belongs inside the state object.



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

Search: