DEV Community

Discussion on: Which mainstream programming language has the ugliest syntax?

Collapse
 
christopheriolo profile image
Christophe Riolo

You put OCaml in "nice syntax" and Haskell in "don't like". I've learned programming mostly with OCaml so I love it but I've been considering also learning Haskell, since I believe it is more popular. Would you say your view why you don't like Haskell? :)

Collapse
 
eljayadobe profile image
Eljay-Adobe

I find OCaml's syntax to be very, very clean, and Haskell's syntax to be unnecessary awkward and clumsy. YMMV.

Thread Thread
 
christopheriolo profile image
Christophe Riolo

Well I like the globally unambiguous (except for variants with parameters arguably) and above all unforgiving syntax of ocaml so I will surely agree :)

Thread Thread
 
mudia profile image
mudia

I am an amateur and seeking what to learn. It seems that Haskell is the holy grail of functional programming. I think OCaml only has success because it caught on in certain European Universities (especially in France).

In terms of popularity though, it seems that its reputation fro being too difficult has held it back. However, there are enough people that tell you that Scala sucks as a functional programming language. I tried starting it, and it's just ugly and tedious.

Anyway, as you are an OCaml expert maybe something like this will help you
science.raphael.poss.name/haskell-...

Thread Thread
 
eljayadobe profile image
Eljay-Adobe

Thank you for you interest.

Since you are seeking what to learn, and you are enjoying Haskell, I would say stick with Haskell.

Programming languages are tools. If Haskell can handle the kinds of problems that you are working on, then that's a good tool for the job.

If you discover a programming challenge that Haskell is not the right tool for the job, then that would be a good time to consider alternative languages.

Regardless, Haskell will teach you a lot of good programming habits. And those good habits will be applicable to any other programming language you learn in the future.

Collapse
 
eljayadobe profile image
Eljay-Adobe

I think plain OCaml and Haskell are probably about tied for popularity.

If you include F# as a kind of OCaml (since it is pretty much OCaml for .NET, as a first-class supported citizen by Microsoft), then OCaml wins the popularity contest in a landslide.

If you are deciding between Haskell versus Scala or Clojure ... well, I think either Scala or Clojure have Haskell beat.

Haskell is a pure FP.

Clojure is Lisp with FP added. (Normally targeting JVM, but can target .NET or transpile to JavaScript. Probably a bother to target .NET or JS.)

Scala is OO, with FP; targeting JVM. (In contrast to F# which is FP, with OO added in order to support .NET requirements.)

Thread Thread
 
mudia profile image
mudia

I find it fascinating that you think that Haskell uglier than OCaml! As a new hobby/amateur programmer, I find that your description of the two languages is the exact opposite. I know nothing of OCaml but just looking at comparisons of code and it seems that both languages are similar but Haskell is cleaner and has some nicer syntax options, especially when it comes to function composition.