• Kacarott@aussie.zone
    link
    fedilink
    arrow-up
    37
    ·
    2 days ago

    If you are bored of writing Brainfuck in your spare time, try Lambda Calculus instead as an exciting alternative!

    • Destide@feddit.ukOP
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 day ago

      But how many burritos is that.

      Lets find out! Count = λB. (B (λx. (x + 1)) 0)

      3 its 3 burriotos you’re going to have to pop out and get 8 more for the other commenters

  • HStone32@lemmy.world
    link
    fedilink
    arrow-up
    9
    arrow-down
    7
    ·
    2 days ago

    It would be extremely annoying to be forced to write all my code functionally.

    But I find it even more annoying to be forced to write all my code object oriented. Looking at you, python and java.

    • expr@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      15 hours ago

      Unless you’re writing Scala or something (which is probably the one exception to the rule), if you are using a language that supports OOP, you’re not really doing functional programming. Functional-esque features that have made their way into imperative languages like map are only a tiny fraction of the functional toolbox.

      There’s a bunch of features you want in a language to do functional programming, and imperative languages don’t really have them, like purity by default (and consequently, an orientation towards values rather than references) ergonomic function composition, algebraic data types, pattern matching, support for treating everything as first class expressions/values, etc.

      Perhaps this is presumptious (and I apologize in advance if so), but I’d wager you haven’t truly programmed in the functional paradigm. What imperative programmers tend to think of functional programming is very surface-level and not really reflective of what it actually is. It’s an entirely different beast from imperative programming. It requires a shift of your mindset and how you think about programs as a whole.

      Source: Senior software engineer writing Haskell full time for the last 4 years. Will avoid OOP until my dying breath.

    • TimeSquirrel@kbin.melroy.org
      link
      fedilink
      arrow-up
      7
      ·
      1 day ago

      C++. Do whatever the hell you want, it doesn’t care. Mix paradigms all day long.

      People complain about its complexity and the fact that it has everything including the kitchen sink, but that is exactly why I love it. It gives you choice.

      • HStone32@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        Nah, coding is one of the few things I don’t find annoying, so long as the language or toolsets I’m using allow for freedom. What I find annoying is when some talking head says all code should be a certain way, and everybody believes them for some reason.

      • expr@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        16 hours ago

        It basically does. It pretends to court functional programming while actually being really antithetical to it in basically every way. Guido Van Rossum has vocally expressed his dislike for functional programming (though I’d argue he actually doesn’t really know much about it).