4 ms·
I agree with your evaluation that parts of the FP community are extremely vocal and extremely smug, and this can and does have a bad effect on a community. Thi
by 9q9 6y ago
I agree with your evaluation that parts of the FP community are extremely vocal and extremely smug, and this can and does have a bad effect on a community. This is a problem.
Dealing with this problem requires leadership. In particular a project leader typically has to decide (in a Scala context) whether to go FP or imperative, because mixing both is often a problem. Similar to e.g. using message passing or shared memory for communication between threads.
throw exception
This is a good example. It is really important to be very clear from Day 1 how to handle errors in a project. One hybrid choice that is popular is: use exceptions for errors that you cannot recover from, use Options for local error handling.
- erik_seaberg 6y agoOption does throw away the error. I like Try { expr } a lot, to the point that I retry, give up, and then serialize a Try[T <: Product] into a Row so flaky dependencies don't trash all the output from a big Spark job.
- 9q9 6y agoYes, that's true, if you want to propagate information about the nature of what went wrong locally (e.g. logging) you need to use something richer (e.g. Either).
- erik_seaberg 6y agoYeah, Try[T] is basically Either[Throwable, T] with some glue for catching and rethrowing.