• bdonvr@thelemmy.club
    link
    fedilink
    arrow-up
    23
    ·
    5 hours ago

    Watches Computerphile, thinks it’s actual programming

    What is this even supposed to imply

    • Rusty Shackleford@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      14 minutes ago

      Personally, I love that series. I guess whoever made this meme thinks people who watch the show are trying to implement their code examples in production.

      • lad@programming.dev
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 hour ago

        I think, the point is Haskell is more CS theoretical than practical language and anyone who uses it (or any other FP) has never written a single line of production code (the last statement is even in the meme)

    • rainwall@piefed.social
      link
      fedilink
      English
      arrow-up
      74
      ·
      7 hours ago

      Imperative stonager works there too. You’ve just never seen him because he hasen’t accepted a meeting invite is 14 years.

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      6 hours ago

      I think I’m a little bit of everyone except him. I work as a web dev, love functional programming and/with TypeScript. 😅

      • call_me_xale@lemmy.zip
        link
        fedilink
        arrow-up
        3
        ·
        2 hours ago

        This. I’ve been writing some game mods in it recently and LINQ is… pretty nice. switch expressions, too.

        This is coming from a dude formerly from the “OOP Boilerplater” camp, though, so maybe I just have low standards.

  • andioop@programming.dev
    link
    fedilink
    English
    arrow-up
    13
    ·
    6 hours ago

    OOP boilerplater except for the Windows bit; trying to slowly move off proprietary software and choose open source when I can

    • passepartout@feddit.orgOP
      link
      fedilink
      arrow-up
      7
      ·
      6 hours ago

      Same honestly, it’s a hustle to convince the Java EE dinosaurs of new paradigms. Never going back to Micro$lop though.

  • Phoenixz@lemmy.ca
    link
    fedilink
    arrow-up
    6
    ·
    6 hours ago

    Is there a panel for the pragmatist that just goes with what works, with open source strongly preferred?

    • silasmariner@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      2 hours ago

      No, because the whole point of this meme is to be entirely devoid of nuance. Functional programming is fucking awesome if product is changing its mind every 5 mins, Oop is great if you have a huge number of junior Devs, rust isn’t remotely slow so god knows what bottom right is about, top left probably has more functionality defects than you can shake a stick at but he’s lionised here. Don’t think too hard about it – OP didn’t (also ‘never bashes python or JavaScript’? Absolute weaksauce. Perl and PHP are the ones ppl bash because of entry level dev memes. Embarrassed for op)

  • potatoguy@lemmy.eco.br
    link
    fedilink
    arrow-up
    18
    ·
    8 hours ago

    Hear me out:

    Mixing OOP and functional code to abstract the shit out of everything making 5k loc in around 500 loc in java. You can do magic using this trick.

    • passepartout@feddit.orgOP
      link
      fedilink
      arrow-up
      17
      ·
      8 hours ago

      Functional programming in Java is kind of an afterthought and it shows. That’s one of the reasons why Scala was created!

        • marcos@lemmy.world
          link
          fedilink
          arrow-up
          5
          arrow-down
          2
          ·
          2 hours ago

          Just let C++ die already, and stop pretending it’s a reasonable thing to compare other languages with.

          If you can’t do it in C, you are better in Java, Python, Haskell, whatever.

      • potatoguy@lemmy.eco.br
        link
        fedilink
        arrow-up
        7
        ·
        8 hours ago

        Yeah, Scala is the GOAT, but while I can’t use, why not final everything, use 300 streams and pass Suppliers around?

        (I’m building a lot of libraries at work)

        • silasmariner@programming.dev
          link
          fedilink
          arrow-up
          4
          ·
          2 hours ago

          Do people still use vavr? When I wasn’t allowed to use scala that made up for a fair few shortcomings but it’s probably less relevant than it used to be

          • potatoguy@lemmy.eco.br
            link
            fedilink
            arrow-up
            4
            ·
            edit-2
            2 hours ago

            I didn’t know about vavr, I think a lot of things from it were added since Java 17, but this Try<T> seems cool.

            Edit: Either would be nice too. I’m going to test some of those things, thanks for the recommendation!

            • silasmariner@programming.dev
              link
              fedilink
              arrow-up
              4
              ·
              1 hour ago

              Very pleased to have been of help! I love scala but Java really isn’t too bad (streams API is fine except that you need to explicitly move in and out, rather than getting to do the cool scala thing of just using methods in the phenomenal collections library) and I don’t like dunking on it, but it really does need a few helper libs. Tuples, either and try I think vavr has. Java seems to have covered most other stuff now. But been a half decade since I’ve written more than 10 lines at a time so hasn’t come up for a while. Sorry. Reminiscing. Sunday night blues.

  • 9point6@lemmy.world
    link
    fedilink
    arrow-up
    17
    arrow-down
    1
    ·
    edit-2
    8 hours ago

    Oh, I guess I’m a stoneager with a penchant for functional elitism then.

    Though I will admit OOP is valid for involved data modelling, everything else should be functional though.

    I’ve also trained myself out of most short variable names for maintainability reasons

    • Valmond@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      1
      ·
      24 minutes ago

      Yeah, it’s wild people “don’t like OOP” 100%, it’s like most good things, don’t put it where it shouldn’t be.

    • masterspace@lemmy.ca
      link
      fedilink
      English
      arrow-up
      13
      ·
      edit-2
      6 hours ago

      Outside of the for loop counters i and j, short variable names are awful. Coming back to old code written with abr var nams is like talking to someone in the military who just constantly throws out jargon and acronyms that they know you don’t know.

      But so are Java style ObserverFactoryManagerTemplateMachinistTemplater names.

      There’s a sweet middle ground of short, but actually descriptive name. Sometimes it’s not possible but that’s usually a code organization / language / framework smell.

      Too short variable names is usually a sign that you need to use a proper ide, with auto complete, or that you need to use a proper build process that will minify your code after the fact.

      Too long names are usually a sign that your module of code (function, class, namespace, etc) is too large, or that your language/framework naming conventions are too strict, or the language doesn’t encapsulate scope properly.

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

        The length of variable and function names should be proportional to the size of the code that can potentially call them. And preferably segmented in namespaces, explicit modules, or something like that.

      • red_tomato@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        6 hours ago

        Outside of the for loop counters i and j, short variable names are awful.

        I’ve started to prefer writing it out as ”index” or ”iteration” even in for loop counters. It’s easier to read, and not much harder to type.

            • silasmariner@programming.dev
              link
              fedilink
              arrow-up
              2
              ·
              edit-2
              9 minutes ago

              I is a vowel too but you sure can!

              Edit: also I noticed you dropped one ‘y’ but not the others. Is this an accident or some subtlety to do with y’s ‘semi-vowel’ status? To be discussed.

        • FishFace@piefed.social
          link
          fedilink
          English
          arrow-up
          3
          arrow-down
          1
          ·
          5 hours ago

          Keeping things that can be on one line to one line is a good reason to use short variable names where it won’t be confusing. Writing “iteration” sounds absolutely perverse!

          The thing is, everyone understands i and j. The reason calling variables hcv or iid is dumb is because noone knows what that means - quite a different situation.

          • red_tomato@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            5 hours ago

            Writing “iteration” sounds absolutely perverse!

            I like it to make it clear when the for loop is about iterating lists and when it’s not. For example, the iterations in Monte Carlo algorithms doesn’t correspond to items in a list.

        • masterspace@lemmy.ca
          link
          fedilink
          English
          arrow-up
          2
          ·
          6 hours ago

          I typically do too, or userIndex or something for nested loops, but I will accept i and j for the first two levels of nesting when reviewing a PR because they’re such a convention. I wouldn’t accept variable names like that anywhere else though and try and avoid them myself.