Opinions on functional programming and OCaml
I&#x27;m gonna have to defend vjeux here a bit. Disclaimer: I work on Reason (and help manage its community), a layer on top of OCaml, and targeted (well, cited) in the post. I&#x27;ve known vjeux for a while too. If he&#x27;s accused of being a &quot;junior engineer&quot; then I don&#x27;t know what the heck most of us are doing.<p>Lack of names: this deserves to be solved. OCaml in particular pays a bit more attention to it than others. Labeled arguments, inline records, objects, variant constructors, etc. are all solutions to this. Tuple&#x27;s usually the target of criticism when it comes to lack of names, and I do think the criticism is mostly valid. The convenient-ness of a language feature dictates its usage. When you can trivially return an obj&#x2F;map from js&#x2F;clojure you wouldn&#x27;t resort to returning an array of 2 elements. But when these alternatives are heavier in a language (ocaml objs are rather heavy visually and have no destructuring; records need upfront declaration), you do see a bit more of the proliferation of tuples. This can be solved, but since it&#x27;s deemed an &quot;uninteresting&quot; problem, it stays as one of the low-hanging fruits. In general, though, I&#x27;ve come to appreciate OCaml&#x27;s pragmatism regarding these matters. It does try to solve these language usability concerns. The other offender is parametric types, but the situation is the same in typed JS solutions.<p>Hard to track &quot;mutations&quot;: tangentially related, but in parallel universe where FP is pervasive, I can see how folks might say &quot;hey this pattern of passing a self-like argument first is used so often, we should create a new syntax for it (dot access) and optimize it specially for perf &amp; tooling&quot;. Anyway, uniformity by definition erases distinguishability; sometimes the distinguishability is appreciated for e.g. perf and ease of grepping. Note how recent JS syntactical features are almost always faster than their polyfilled equivalent (obj spread, async, generator, arrow function).<p>Partial evaluation: the &quot;monad&quot; of beginner FP experience basically, in terms of social effects. From watching the community for so long, currying often seem to elicit a period of &quot;this is weird -&gt; oh I get it -&gt; this is the greatest thing and I&#x27;ll violently defend it against naysayers -&gt; you know what, it&#x27;s not all great; it&#x27;s fine&quot;. Currying in an eager, side-effectful language is actually troublesome to implement &amp; use. Some compilers don&#x27;t optimize them, or worse don&#x27;t even get them semantically right. Won&#x27;t cite examples.<p>Higher-order functions: same problem in JS. But yeah, combined with partial app this isn&#x27;t immediately clear: `Foo.bar(baz(qux))`. What&#x27;s the arity of `baz`? More importantly, at what &quot;stage&#x2F;state&quot; of the function&#x27;s logic are we at now? For that specific example, you can argue that the name `x` isn&#x27;t that much more indicative (which ties back to the first point). But these are the exceptions rather than the norm. I&#x27;m sure people are fine reading `map(foo)`. The general point&#x27;s still valid.<p>===========<p>I&#x27;ll stop here because I&#x27;m bored, but you can see how these things aren&#x27;t black and white once everyone just take a deep breath, think a little, and find a way to communicate a bit more nicely with each other. In some of the above points, I&#x27;m playing the devil&#x27;s advocate because I feel it&#x27;s needed to balance the overwhelmingly negative sentiment. Sorry if my emotions come through a bit here, but it&#x27;s a bit sad to see that that some of the less polite replies I&#x27;ve seen come from FP folks who actually barely started FP, through ReactJS&#x2F;React Native, got overly excited to finally find a target to criticize in an act of catharsis, without realizing they&#x27;re criticizing the co-author of said frameworks. Look, people are watching; disregarding whether the author&#x27;s points are right, you&#x27;ll be judged on how you react to them. And your collective reaction is a good assessment of how resilient the paradigm is against the real-world&#x27;s sometimes nitpicky, sometimes serious, criticisms. The best engineers I&#x27;ve worked&#x2F;am working with, are able to cite tradeoffs and admit that their paradigm isn&#x27;t perfect. It&#x27;s an indicator that you&#x27;ve finally &quot;got it&quot;, that you&#x27;re able to assess a subject&#x27;s nuances rather than seeing it as a binary thing.<p>I&#x27;m a bit frustrated to see that vjeux&#x27;s post had to be retracted and that he had to apologize. Imagine the potential improvements we could have collectively made had these issues not been casually&#x2F;emotionally dismissed. Now once again the gist and this reply will be forgotten and we&#x27;ll have to move on and count on word-of-mouth to propagate solutions to these criticisms rather than codify it somewhere like the programmers we should be. On the other hand, I am glad to see that most of the harsh replies don&#x27;t come from the Reason community. Ultimately, I wish the community to learn to welcome newcomers, to learn _how_ to educate (and not just what), to understand FP&#x27;s tradeoffs, to stay mature to get work done.