Hacker News new | ask | show | jobs
by ritchiea 1692 days ago
I think it’s subjective. I learned Haskell early on in university and I’ve learned Lisps and it still feels like extra work to reason about programs or model domains in functional languages.

I believe functional programming advocates when you guys say it works better. But I only believe it works better for you. In my experience there’s a minority of people who find functional programming to be a powerful paradigm shift but for most developers functional programming either doesn’t resonate or resonates at the level of an academic exercise that helps you think better about writing code but best remains an academic exercise.

3 comments

It can be extra work to reason about the performance and efficiency of functional programs, such is the case with higher level languages. But modelling the domain is far easier. I can solve difficult problems using Haskell, e.g. writing a specialist DSL compiler targeting a GPU. I'm just not smart or patient enough to solve such problems in C/C++ or Java, although I do concede that many can.
I did the same path as you.

I think that the procedural programming is much more common because of the academic and work experience of many programmers. Functional programming is a transition of the way of thinking that seems not worth it. But after I got my hands dirty, I found myself writing much more clean and consistent code in every language. I enjoyed particularly Clojure because has a good ecosystem and tools, and also take some design decisions to steer you for a more robust code. https://clojure.org/about/functional_programming#_immutable_...

I broadly agree. I actually think most people are most at home in the procedural domain, and most just write procedural code in OOP languages. Which is hard to do in an FP.
Erlang is often described as having an imperative core. It was my gateway drug for FP, I certainly found it much easier to grasp and write than any Lisp.
As did I. I went imperative languages -> Haskell (wtf) -> Clojure (wtf) -> Erlang (love it) -> Clojure (love it) -> Elixir (love it).

My two favorite languages these days are Clojure and Elixir. Currently mostly Clojure because my main side project is more amenable to Clojure's methods of concurrency than Elixir.