this post was submitted on 30 Sep 2023
61 points (85.1% liked)

Programming

17378 readers
237 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] FizzyOrange 6 points 1 year ago

I agree. OCaml too. I think there are several factors that lead to it being very difficult to read other people's code:

  • Currying and lack of syntax in general means you have to be a human parser for basic things like "which part of the text is a function name? which bits are arguments?". Often it's impossible to tell without looking up the function definitions.
  • The functional style - while generally great - also makes it very tempting for people to write enormous heavily nested functions where the control flow is hard to follow. You sometimes get assignment expressions that are hundreds of lines long.
  • Haskel & OCaml feature global type inference. Programmers often omit explicit type annotations which very often means that function types are inferred as generic. This means you lose several huge benefits from static types. For example you can no longer look up the types that will actually be passed into the function, and inferring the authors intent is much harder. It also makes error messages way more confusing.
  • I don't know why but Haskel and OCaml programmers love stupidly short identifiers.
  • They also abhor comments.