• mnemonicmonkeys@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    While the concept has it’s uses as a tool, the fallacy that OOP advocates fall into is overusing it.

    I’ve seen many people completely swear off of using scripts, which is absolutely ridiculous. While you may use some tools more than others, swearing off an entire code structure for no reason is ridiculous.

    Say there’s a module of code you need to write that has hundres if not thousands of variables that come into play in combinations that would be extremely difficult to organize as functions. You’re then stuck with passing all those as inputs and outputs between functions.

    Sure, you could organize all those variables as a giant array and pass them around as one big block, but at that point you’re just emulating the shared workspace that you get with scripts, and you’d just be better off working with scripts from the start.

    The issue with OOP is that it completely ignores this reality and insists that nobody should ever need a script, and if they think they do then they just aren’t clever enough.

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

      Well you’re not wrong, but man, you’re hating the screwdriver because you work in a bolt factory.

      Use the took that best suits your problem, right?

      Also: what’s that code that has thousands of variables that cannot be organised? If it isn’t just an example for the sake of an example, I’m genuinely curious! And how does scripts “fix” that?

      Also: I have always hated java for their overuse of OOP, but also restricting its use, wtf.

      Also: I love a straightforward script, on linux at least!

      • mnemonicmonkeys@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 hours ago

        Well you’re not wrong, but man, you’re hating the screwdriver because you work in a bolt factory.

        Like I said, the problem with OOP advocates is that most of them are calling for bolts to be destroyed in this analogy. If they weren’t so fanatical about it we wouldn’t be havining this conversation.

        what’s that code that has thousands of variables that cannot be organised?

        It’s not a random example. I can’t go into detail, but it’s the code I work on on a daily basis. It’s a physics model for industrial equipment. Highly customizable for customers, and I need to know exactly where various sub assemblies are located and be able to move them in various configurations.

        And scripts doesn’t “fix” the problem. It’s more that using functions is infeasible due to the difficulty in cramming everything into input arrays, so scripts end up being orders of magnitude more efficient to work with. The scripts are all called from a function, which does allow us to interface with other groups or our own custom GUI.

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

          That’s wild, I have worked on large scientific software, coupled with electron microscopes (off all kind of types, bio, material, big, small) and we had over 700 types of processings of different data and visualisation. Without OOP in there it would have been a one man orchestra-mess per client.

          We had those people clinging to their scripts too, they were actually the best getting the results out from bad aquisitions, but it’s kind of complicated because it’s not the scripts that are important but the dude using them.

          The OOP was good because it tied it all together (you could easily string compute modules together to form new treatments of data for example), that’s not needed in a small, one-situation setup, but still I’d code something to manage it all if I were you (and had the possibility to do so ofc), maybe your gui does that. But then again, I don’t know how it all works where you work so what do I know 🤷🏻‍♀️.

          Cheers