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

In this example, I would start with the FP solution because that's how I happen to think. Probably familiarity bias, but I find the cognitive load much lower.

If performance becomes a problem (it might, after all there are several more passes than strictly necessary), have tests in place and refactor to an optimised imperative version.



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

Search: