• 0 Posts
  • 25 Comments
Joined 11 months ago
cake
Cake day: August 4th, 2023

help-circle



  • I don’t think that the anti-oop collective is attacking polymorphism or overloading - both are important in functional programming. And let’s add encapsulation and implementation hiding to this list.

    The argument is that OOP makes the wrong abstractions. Inheritance (as OOP models it) is quite rare on business entities. The other major example cited is that an algorithm written in the OOP style ends up distributing its code across the different classes, and therefore

    1. It is difficult to understand: the developer has to open two, three or more different classes to view the whole algorithm
    2. It is inefficient: because the algorithm is distributed over many classes and instances, as the algorithm runs, there are a lot of unnecessary calls (eg one method on one instance has to iterate over many instances of its children, and each child has to iterate over its children) and data has to pass through these function calls.

    Instead of this, the functional programmer says, you should write the algorithm as a function (or several functions) in one place, so it’s the function that walks the object structure. The navigation is done using tools like apply or map rather than a loop in a method on the parent instance.

    A key insight in this approach is that the way an algorithm walks the data structure is the responsibility of the algorithm rather than a responsibility that is shared across many classes and subclasses.

    In general, I think this is a valid point - when you are writing algorithms over the whole dataset. OOP does have some counterpoints encapsulating behaviour on just that object for example validating the object’s private members, or data processing for that object and its immediate children or peers.






  • Elon sounds like he’s experienced, skilled and is approaching things from a theoretical or ethical or other grand point of view. He used to impress me with his approach on building an electric car company with full self-driving vehicles in the 2010’s. I wasn’t a full believer, but I thought he was competent and wanted Tesla to succeed.

    Then he went and bought Twitter. As a software engineer all my life, and in the startup scene, and having worked in a failed social media platform, I have some experience. Everything he’s said about Twitter is crap and everything he’s done is stupid. And the results speak for themselves.

    I’ve seen people say that Elon sounds great about things they don’t know too much about. But when the topic comes to things they do understand, Elon clearly is wrong.

    He started his career with hundreds of millions of dollars, and he bet it all on a couple of businesses be bought (he was never a founder, always a purchaser).

    Basically he’s been lucky twice (Paypal and Tesla), but each of these won 10-100x on his initial stake.



  • This is exactly the answer.

    I’d just expand on one thing: many systems have multiple apps that need to run at the same time. Each app has its own dependencies, sometimes requiring a specific version of a library.

    In this situation, it’s very easy for one app to need v1 of MyCleverLibrary (and fails with v2) and another needs v2 (and fails with v1). And then at the next OS update, the distro updates to v2.5 and breaks everything.

    In this situation, before containers, you will be stuck, or have some difficult workrounds including different LD_LIBRARY_PATH settings that then break at the next update.

    Using containers, each app has its own libraries at the correct and tested versions. These subtle interdependencies are eliminated and packages ‘just work’.






  • modeler@lemmy.worldtoTechnology@lemmy.ml*Permanently Deleted*
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    8 months ago

    Not really. People shed skin and hair constantly, and the small particles float in the air and distribute themselves throughout the volume. And your bacteria are along for the ride. One of the functions of the protective suits, gloves and hairnets is to contain these these particles and thus keep the air as clean as possible. When combined with lamina airflow, positive room pressure and other techniques, it keeps contamination down hugely.