4 ms·
> Ocaml was my first programming language lmao what. how. like what course of events.... I had several years professional experience, including functional pro
by 8fGTBjZxBcHq 5y ago
> Ocaml was my first programming language
lmao what. how. like what course of events....
I had several years professional experience, including functional programming, and still found it pretty rough going for a while. And even other professionals have often not even heard of it.
- fiddlerwoaroof 5y agoMy observation (and, I believe the authors of How to Design Programs have some data about this) is that FP is only “hard to learn” if you already know how to program: you have to unlearn things like “for loops” and various techniques that rely on mutation and learn to think in terms of the abstractions FP provides you.
- 8fGTBjZxBcHq 5y agoSo the biggest barrier that I found when learning ocaml was there were just not a lot of resources or organic examples around. What there is is usually for a specific course, or is published by like Jane Street or some shit and highly domain-specific as well. I just found it hard to dig myself out when I ran into trouble. I definitely agree about the FP concepts being no more difficult or even simpler to learn. I used to teach introductory programming to adults and at first we taught loops then map/filter etc and told students to use their preference. Almost universally they used map, including complete synthesis of the entire concept of iteration without loops. Like when presented with a loop, I once saw a student skim the internal logic, see that it was doing an array push inside an if, and call it "a filter loop." To him the filter was the concept and the loop the tool, which is I think backwards from a lot of us.
- Leherenn 5y agoPerhaps unsurprisingly given its origin, but it's often the case in France.
- jhnct 5y agoExactly, started university in Paris in 2004 and OCaml was used to teach data structures for instance. First year was Scheme and C, second year had Java, OCaml, more C, some C++ if you wanted and Mips. Third year added Ada and .Net if I remember correctly.
- tnecio 5y agoOne reason might be that it's used as a programming language for 1st-year courses in Computer Science at some European universities.
- nestorD 5y agoI discovered computer science in preparatory classes (a French thing that comes before engineering school, you can think of it as the first years of college) in France where it was the default programming language (I believe they now start with Python and include Ocaml only if you take some options). Interestingly, it was the students with previous programming experience who had the most difficulties learning the language. I have not found the reverse to be true, the Ocaml compiler is very strict, but it makes you attentive to details and types in a way that transfers well to other languages.
- dalmo3 5y agoOCaml was also my first programming language. First year uni in Brazil, 2006! Thanks to a very tough French professor. The class hated it/him. Type errors were nothing short of terrifying. `function has type (a->(b->c)->(b->d)) but should have type (a->b->(c->b)->d)` or such. If you passed the class (a big if), you'd move on to C++ and OOP and never see Ocaml/functional again. I appreciated it for providing me so much understanding wrt mathematical thinking - functional programming, recursion, induction. Later on I took some classes/researching using SML. Fast-forward ~12 years and I get into web dev and what I see functional programming trending!? Kinda funny... I want to get into it somehow, probably Clojure this time. It just resonates with my thinking - maybe a product of being primed for it all those years ago.
- nix23 5y agoWhy not? If you Studied CS at the ETH (~10y ago) you learned Oberon as your first language.