Mine is that the useState hook is an actual plague on the entire React ecosystem. Regardless of your opinions of React, if you wanna use something then use it right.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      12 hours ago

      There’s nothing in Functional Programming that stops you from writing in an Object Oriented idiom…

      • PortNull@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        9 hours ago

        There are no objects in a pure functional language. No mutable types. Could you give an example of what you mean please?

        • marcos@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          9 hours ago

          Oh, right, there is no mutability. There is just some context you chain from one function to another, that gets abstracting exactly as changes into some existing state.

          Oh, and all that running in a mutability place-oriented imperative machine.

    • ThirdConsul@lemmy.zip
      link
      fedilink
      arrow-up
      6
      ·
      14 hours ago

      Could you define what you mean by functional and ooo in practice, because to many people in pracitce functionsl is a garbage monad wrapper over anything with unreadable, undebugable code whose only purpose is to hide if else statements… and it doesn’t even do that; while ooo is java factory of factoties mixed with aspect programming and 20 levels of inheritance.

      • PortNull@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        9 hours ago

        No classes, no mutable types, pure functions where possible (I/O functions exist). I like elixir myself. I use for loops or recursion depending on which is suitable and most understandable. I like the pipe operator because I’ve gotten used to chaining inputs and outputs like that from Linux CLI.

        I prefer functional programming, but also use OO, each their own, but i prefer functional and find it better to write and read

        • ThirdConsul@lemmy.zip
          link
          fedilink
          arrow-up
          1
          ·
          6 hours ago

          Okay, so… Method chaining, and no refs being passed as params, and structs.

          I dislike pure functional programing (not the same as pure functions) because of the boilerplate you need. Want to add a cache? Add a state monad throught the whole pipeline.

          Want to have readable code in a six month? Forget it, because you’re gonna write in point free style, compositiona without naming inputs and outputs, so that the next time you visit this place, you’ll have to check every function for them.

      • wewbull@feddit.uk
        link
        fedilink
        English
        arrow-up
        3
        ·
        12 hours ago

        Not Op but…

        OO languages have classes with inheritance based polymorphism. I don’t see struts + methods as enough to qualify.

        Functional languages have functions which can take functions as arguments and function composition as first class features.

    • NoLemurs@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      14 hours ago

      100% agreed, though I’m in the “neither is ideal” camp. My favorite language, by a long way at this point is Rust.

      It’s not functional, but borrows a lot of functional idioms while avoiding the pain points functional language usually hit in exchange for losing the purity of functional languages.

      • PortNull@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        9 hours ago

        Nah, no language is “perfect” once you’ve used it enough I write python for money and elixir in my own time. I borrow implementation approaches from functional when it’s appropriate. Avoid using complex classes, especially if the encapsulate state. But they have their uses and people should chose which works best for their use case

        I wouldn’t write cli tools in elixir for example.