Hacker News new | ask | show | jobs
by superboum 4036 days ago
Same feeling, and why are they ignoring EVERY programming convention ? One more thing I really hate is there are many way to the same basic thing, ie. declaring a new function or doing a pattern matching. Finally, standard libraries are not well named (List.split will not do what you think) nor easy to use (List.last ? Nope !).
3 comments

There are two things here:

1. "unfamiliar" syntax. Well... It is unfamiliar if your first exposure to programming stopped at Java. Guess what .. pattern matching is quite an old convention in programming languages old (Prolog, Erlang, ML, Haskell)... and new (Rust, Swift)..

2. Standard libraries are a crap shoot... cruft accumulates in standard libraries just like any piece of software but harder to clean up owing to demands of backward compatibility. Just go and look at Python standard library. Even on a superficial level, the stdlib is a mix of CamelCase and under_score .. which can be irritating.

OCaml is not unique in this regard.

There is zero need for a general purpose List.last. It encourages programming using List.last, when in most cases that leads to crap performance (as it would run in O(n) time).

It's a one line function to write, but it certainly has no business being in the standard library.

This is very consistently my biggest problem with OCaml: it just doesn't follow conventions set in other ecosystems. I predict this is the sole reason it could never be "the next Java."

It's worth noting, however, that I've had very, very few problems with the semantic properties of the language. I think the slog is worth it for that reason.

> This is very consistently my biggest problem with OCaml: it just doesn't follow conventions set in other ecosystems.

Well, the reason is that Caml predates those ecosystems; the original Caml was released nearly a decade before Java [1], and ML itself dates back to the 1970s.

[1] http://caml.inria.fr/about/history.en.html

Right. I mean only to say that OCaml's superficial strangeness is regrettably offputting.

Talk of syntax is almost always history and religion, not science.