News for hackers. Stuff that matters.
Re:Strings Just Got Faster by SkiFire13 on Saturday May 03, 2025 @02:31AM (#43877249)
Did you actually started to appreciate the same OOP that made class situations impossible to understand or did you gradually switched to a simplier OOP, made up of mostly interfaces and classes that implement them (as opposed to extending other classes)?

In my experience OOP is actually pretty pleasant to work with if you avoid extending classes as much as possible.

> These kinds of niche optimizations are still significant. The OOP model allows them to be implemented with much less fanfare.

If you're referring to the optimization in the article posted then I would argue an OOP model is not needed for it, just having encapsulation is enough.

Re:Strings Just Got Faster by Etheryte on Saturday May 03, 2025 @04:46AM (#43877707)
I'm not sure if the argument that OOP is pleasant so long as you avoid any OOP is a very sturdy one.
Re:Strings Just Got Faster by SkiFire13 on Saturday May 03, 2025 @08:00AM (#43878501)
OOP is the combination of encapsulation, abstraction, inheritance, and polymorphism. Ignoring inheritance does not mean avoiding OOP altogether.
Re:Strings Just Got Faster by Someone on Saturday May 03, 2025 @09:14AM (#43878848)
Also note that the OP said “avoid extending classes”, but didn’t say “avoid implementing interfaces”, so they don’t disallow inheritance in a wide sense of the word.

I think “avoid extending classes” is there because it is as good as impossible to design classes that can be extended easily in ways you do not foresee, and if you do foresee how your classes could be extended, it often is easier for your users if you made your classes more flexible, to start with.

Re:Strings Just Got Faster by hajile on Saturday May 03, 2025 @09:55AM (#43879054)
You can get Encapsulation, abstraction, and polymorphism any number of other ways. Inheritance is the only defining property of OOP.

If you removed all the stuff related to inheritance and trying to fix the leaky abstraction that is objects, the language would be a fraction of the size (compare with Go or StandardML for how small a language without inheritance can be).

Re:Strings Just Got Faster by zelphirkalt on Saturday May 03, 2025 @10:25AM (#43879232)
And as for inheritance: Composition over inheritance. So .... just don't do OOP, I guess?
Re:Strings Just Got Faster by turtles3 on Saturday May 03, 2025 @06:59AM (#43878208)
I'd say that the 'poor man's closures' aspect of OOP - that is, being able to package some context along with behaviour is the most useful part for day to day code. Only occasionally is inheritance of anything other than an interface valuable.

Whether or not this is an endorsement of OOP or a criticism is open to interpretation.

Re:Strings Just Got Faster by _old_dude_ on Saturday May 03, 2025 @06:18AM (#43878047)
OOP is great for libraries but leads to overly complex codes for applications.

For a long time, Java was like, every classes is a library, i do not think it's a failure of OOP, it's a failure of Java.

But I'm optimistic, I choose to see recent additions like records and pattern matching has a step in the right direction.

Re:Strings Just Got Faster by gigatexal on Saturday May 03, 2025 @07:47AM (#43878433)
> Did you actually started to appreciate the same OOP that made class situations impossible to understand or did you gradually switched to a simplier OOP, made up of mostly interfaces and classes that implement them (as opposed to extending other classes)?

My thoughts exactly. Give me more classes with shallower inheritance hierarchies. Here is where I think go’s approach makes sense.

Re:Strings Just Got Faster by neuroelectron on Saturday May 03, 2025 @02:58PM (#43881253)
No. Things only get more complicated with more technical debt. The best you can do is manage it with yet another abstraction.