
“Mostly functional” programming does not work - pedrorijo91
http://queue.acm.org/detail.cfm?ref=rss&id=2611829&utm_content=bufferb88da
======
anonyfox
While itself I tend to agree, the typical scenarios for average programmers
are one-off tasks or fairly trivial, aka "fetch stuff from here, apply some
code, store some results there, and maybe run this stuff every X". In these
cases, correctness/absence of bugs are not that important, but the job should
be done ASAP. In situations like this, I vastly prefer _impure_ FP languages,
like Elixir. Just get shit done (eg.: the File module is great!).

On the other hand, when I build more complicated (web) systems, using a
framework like Phoenix, _everything_ is pure, _except_ controllers or custom
API clients, these are the single point of interacting with impure stuff and
can be guarded easily, even dying is acceptable mostly.

The point I'm trying to make is: Monads and complex/strange type systems are
completely unsuited for usage through the average joe programmer, no matter
how much I agree with the topic itself. But there are solutions available that
allow to reap _most_ benefits of pure FP while also allowing to be pragmatic
when appropriate. I mention Elixir here because it is the single best language
that fits in this description I think.

~~~
pedrorijo91
Your comment is somehow similar to my opinion.

The author simply states that when mixing imperative features like exceptions
in a FP languages, sooner or later something is going to be broken, that
wouldn't be in a pure FP language. The example given with the exceptions in a
lazy value/variable is great for showing us that ! Who wouldn't forget that a
Try/Catch block in a lazy val/var would be useless (because it would only
throw the exception when evaluating the val/var) ?

And I agree, pure FP has a lot of benefits, the problem is that is too hard to
create a real system in a pure FP approach. So we often make compromises to
get things done. I use Scala everyday (and used to develop in Java) and I'm
aware of that. Nevertheless, I can avoid a lot of problems comparing to Java
imperative/OO approach.

I see this post more as a reminder that when using impure FP you still have to
be careful about some tricky features

