logoalt Hacker News

zelphirkalttoday at 2:00 AM1 replyview on HN

If you have strong types, it is still possible to make a mutable thing, that will be mutated from the other end of the program and that will introduce bugs, that can be hard to find. If you are doing FP on the other hand, at least change always results in new objects, with structural sharing at most. This excludes a whole category of bugs.


Replies

Jenssontoday at 2:22 AM

> If you are doing FP on the other hand, at least change always results in new objects, with structural sharing at most. This excludes a whole category of bugs.

Not if you program it with a mutable god object to mimic creating a new big state, then you have exactly the same kind of issues.

The issue is if you try to program a transaction flow using object oriented programming, that is not very good, and most work programmers do revolves around involves flows. But when it doesn't then functional programming isn't a very good or reliable solution.

show 1 reply