3 ms·
Actually, I wasn't. The first claim is that there are fewer programmers using OCaml because it's uncommon in industry. The second is that their business has no
by rtl49 11y ago
Actually, I wasn't. The first claim is that there are fewer programmers using OCaml because it's uncommon in industry. The second is that their business has no obvious need for a paradigm which, in my view, requires more education and a stronger understanding of mathematics. I'll admit I don't have any evidence other than personal experience to support the second claim, but the first is easily verified.
- loup-vaillant 11y agoSeriously, I'm quite baffled at the idea that OCaml would be technically demanding. I was taught OCaml in college, along with C, Java, C++, and Prolog. Ocaml was easier than even Java. Much less demanding than the minefield that is C++. And it certainly doesn't require more education. A different education, that's for sure, but not more. As for requiring a stronger understanding of math… Languages like OCaml just don't pretend that programming is not math. So it tends to scare away those who fled math in the first place. C++ and Java are just as mathy (if not more, just see the sheer size of the specifications), but they don't really tell you. <Grumpy Dijkstra> Programming should have been of the applied mathematics department, not the electronic engineering one. </Grumpy Dijkstra>
- rtl49 11y agoI really don't disagree with the substance of your comment, though the Algol-family languages tend to be hard because of disorganized core libraries and occasionally cumbersome syntax rather than because they depend on unfamiliar mathematical constructs. I have little experience in education, but my naive hypothesis is that it would be easier to teach a child, say, Python than any FP-oriented language. I suppose it goes without saying that if children were introduced to the lambda calculus beforehand this might not remain true. See my comment beneath the root to see my clarification of the original post. I don't think Dijkstra would disagree with me. After all, it was he who suggested the average American programmer would benefit "more from learning, say, Latin than yet another programming language."
- thesz 11y agoThe (destructive) assignment is an extra concept in imperative programming compared to functional programming. It is also a form of resource management and incur resource management issues (do I need that value in this variable? Can I overwrite it and discard old value?). The implicit state also is an implicit communication channel between different parts of program. In FP this communication is much more explicit, especially if you use something like Software Transactional Memory. I think I listed enough points for you to reconsider your stance about Python being easier to grasp.
- akhilcacharya 11y agoThe vast majority of schools outside of the upper echelon don't even get close to FP in mandatory classes for CS. I know CMU does, however.
- rtl49 11y agoI know. I was surprised to find that my manager hadn't taken FP, while I had during coursework in computational biology at such a school. I think this just illustrates my point: in industry-oriented programs, FP isn't considered a useful tool. Right or wrong, it's the current reality.
- the_af 11y agoYes, FP is uncommon, though it's gradually becoming less so. However, I'm puzzled about your remark about industry-oriented programs. I'm not sure what "industry-oriented programs" even means, but assuming you actually meant "FP doesn't have widespread use in the industry", I'd say that while this is true, a- it's becoming less true every day, through the use of mixed-paradigm languages, and b- even the purer FP languages see industry use. "Right or wrong" this current reality you mentioned is shifting. Hybrid languages are becoming more common. Traditional languages are adopting functional idioms (and idioms from other paradigms as well!). It's not true that there is a clear-cut "natural" kind of programs for which to use FP; the area for which FP is good is pretty much good old "let's write software that works and has few bugs". If you have this goal, you can use FP to your advantage. Any success story of someone using OCaml for this is welcome.
- rtl49 11y agoBy industry-oriented programs, I'm referring to institutions of higher learning which have tailored their cirricula primarily to prepare their students for employment in industry. I contrast this with those which are intended to prepare their students for research. I've said nothing of depth about the merits of OCaml or FP in itself. I'm simply pointing out that the blog post clearly identifies the use of OCaml as a competitive advantage without discussing any of its drawbacks, whether these arise from the nature of the language itself or for historical reasons. This makes the article significantly less useful for a person trying to select a language for their company's codebase, which I take to be the whole point of writing the post to begin with. Perhaps the real goal of the post was to attract the attention of OCaml developers, rather than discussing the titular question "Why we use OCaml." If this is the case, I'm sorry for having wasted my time criticizing it.
- the_af 11y agoI agree it's uncommon. I disagree it's technically more demanding, even though that's the folklore surrounding FP (technically more demanding than what, anyway?). The need for programming paradigms is seldom "obvious", but I'd say the need for software with fewer bugs and good performance, written in a language developers enjoy using, should be self-evident.