News for hackers. Stuff that matters.
Re:Object-oriented Programming with ANSI-C (1993) [pdf] by jupp0r on Wednesday June 21, 2023 @11:41PM (#36427772)
State can also be shared and reused together with functions operating on it - via composition.
Re:Object-oriented Programming with ANSI-C (1993) [pdf] by Kamq on Thursday June 22, 2023 @12:15AM (#36427949)
Sure, but that's desirable with, maybe, 5% of the code re-use opportunities I run across.

I'm not saying to never use classes. I just got really confused about them being pushed as one of the dominant forms of code-reuse.

Re:Object-oriented Programming with ANSI-C (1993) [pdf] by jupp0r on Thursday June 22, 2023 @01:32AM (#36428330)
Agreed, I think it's been a hype at the beginning of OOP, then got overused in Java in the 90s and subsequently taught to every CS college student and it kind of stuck because in college, you don't get to maintain large software projects.
Re:Object-oriented Programming with ANSI-C (1993) [pdf] by vaughan on Thursday June 22, 2023 @07:24AM (#36430472)
OO is the king of the contrived example

    const dog = new Dog
    dog.woof()
Now you see how simple OO is, let's build banking software.