• noproblemmy@programming.dev
    link
    fedilink
    arrow-up
    21
    arrow-down
    1
    ·
    1 year ago

    Fearing a bit to say it but Haskell. I know that it is a different concept, but it’s not just that for me. The way the elements are separated, sometimes spaces sometimes symbols, makes it hard for me to understand how things are grouped, and what gets plugged into what.

    • dneaves@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      1 year ago

      Haskell for sure has a very sloped learning curve. The functional style, different syntax, a myriad of symbols and pragmas, as well as the tooling around it.

      The only reason I was able to pick it up as quick as I did was because I was used to Elm due to my job. Then it was just learning about the IO type (and how to use it), cabal, stack, built-in symbols, and the most common pragmas.

      But the symbols part is especially harsh, since symbols only hold meaning if they’re universally understood. Sure, the base- language ones are kinda adopted at this point, so they’ll stay, but the fact that external modules can also make symbols (sometimes without actually-named counterparts) adds some confusion. Like, would you just know what .: is supposed to mean off the top of your head?

      • marcos@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        1 year ago

        Like, would you just know what .: is supposed to mean off the top of your head?

        Yeah, it’s point-free shenanigans people use for code-golf and satisfying the linter.

        If you caught yourself using it, you should probably reevaluate.

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      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.
    • Knusper@feddit.de
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      1 year ago

      I write tons of functional code and am still no fan of Haskell’s syntactical choices.

      It’s trying to look like basic English or maths equations, when programming is not that. Programming has more concepts. And those concepts deserve being denoted by punctuation.