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

Sure, we can always translate away state and pass it explicitly.

Some people find some algorithms can be more naturally expressed using state. (And "some people" is a polite way of saying "alot".) The question of whether state can always be replaced by pure functions without loss of asymptotic complexity is open as of April 2016. All I wanted to point out is that there is no need of becoming a functional Taliban: if state is kept local, that's usually fine.

   when you get to more complicated things
Yes. Then don't use it. My rule of thumb is: definition and all uses of state should be visible to the programmer without scrolling.


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

Search: