• 0 Posts
  • 11 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.



  • modeler@lemmy.worldtoNo Stupid Questions@lemmy.worldHow to recognize words
    link
    fedilink
    arrow-up
    8
    arrow-down
    2
    ·
    edit-2
    6 months ago

    If you are anxious about the processing of words, most definitely this is possible, but I am 100% not saying that it is definitely the cause of your problems.

    You are right now highly self-conscious that you might have a crippling brain condition. Also, every time you say something or write something down, you are also monitoring yourself to check out whether it continues to be true or getting worse. In so doing, you might be suffering this effect due to the anxiety that this is causing - you mind is so much more focused on the fear than on the word, which confirms that the word is somehow different in your head now.








  • Maths and reality are different. Very different. Reality can be explored empirically while maths is logic not empirical. We can never say we are 100% sure about the rules/laws we have discovered about our reality, but we can say for sure that a maths theorem is true or false.

    Maths is a set of self-consistent tools that can be used to predict what happens in reality. The mathematical description of reality is an estimate, contains countless assumptions and inaccuracies about where things are and what properties they have. In fact in quantum physics, we literally can’t know momentum and location at the same time.

    Maths can describe (or I should say, approximate) realities that don’t exist.

    Because maths and reality are different domains, we can know different things about them using different approaches.