Hacker News new | ask | show | jobs
by taneq 3407 days ago
I don't think that data flow is a higher level of abstraction to control flow. They're just different types of abstraction, and each has its strengths and weaknesses.

If you only ever work on things that map well to functional programming then you'll naturally think it's superior to imperative programming. Likewise, if you only ever work on things that map well to imperative programming, then the functional programming approach seems a bit silly.

2 comments

Functional code can represent an imperative program (using temporal logic or state monads), so it can be used for domains where you would use imperative code.

It will not always be easier, but it certainly provides more control over the execution flow.

Implementing an algorithm in a functional language almost always requires less code than implementing the same algorithm in an imperative language. That is direct evidence that functional languages are more abstract.