News for hackers. Stuff that matters.
Re:Why is OOP still so widely spread? by lmm on Wednesday September 02, 2020 @08:47PM (#24359815)
What would you expect to be different in a world where OOP really did suck?

It doesn't take any depth of experience to say "oh, it's a tradeoff, there are no good or bad techniques, only tools in your toolbox". It sounds wise. But often it's plain wrong.

Re:Why is OOP still so widely spread? by imtringued on Thursday September 03, 2020 @05:45AM (#24362362)
If it really sucked then people wouldn't use it. It's very easy to spot a universally bad tool. There are these screwdrivers with an integrated lamp to check if a wire is live or not. Only incompetent electricians use single phase testers. Amateurs buy them because they don't want to spend $30+ on a real two phase tester and that's fine because they are going to use them 10 times in the first week and then never again.

The reality is that the difference between general purpose languages aren't that great. Even when highly conservative languages like Java adopt functional programming elements, they don't really add capabilities, they only change convenience. Lambdas are nicer than anonymous classes but they are still equivalent in functionality. The situations in which you absolutely need a purely OOP or FP focused language are pretty rare. People need a language that does a little bit of everything but doesn't go too deep into either end. The problem with feature rich languages is that they are ripe for abuse. When someone discovers a feature for the first time they are going to test it out. People produce a lot of crap in their learning phase that should be thrown out but it ends up in production code bases.

Re:Why is OOP still so widely spread? by lmm on Thursday September 03, 2020 @08:09PM (#24370314)
> It's very easy to spot a universally bad tool. There are these screwdrivers with an integrated lamp to check if a wire is live or not. Only incompetent electricians use single phase testers. Amateurs buy them because they don't want to spend $30+ on a real two phase tester and that's fine because they are going to use them 10 times in the first week and then never again.

Electricians are in a mature profession with established training standards. Software developers aren't.

> The reality is that the difference between general purpose languages aren't that great. Even when highly conservative languages like Java adopt functional programming elements, they don't really add capabilities, they only change convenience. Lambdas are nicer than anonymous classes but they are still equivalent in functionality.

And yet every substantial Java codebase I've seen uses some kind of XML- or annotation-driven reflection/bytecode-manipulation proxying framework to implement something that a functional programming language would just do. Given how many bugs and complexities these frameworks introduce, no-one would use them if they didn't actually need them. So it seems that in practice the language is lacking something important, even if in theory it's "only convenience".

Re:Why is OOP still so widely spread? by codygman on Friday September 04, 2020 @08:19PM (#24380288)
> If it really sucked then people wouldn't use it.

What if they never give an alternative a chance? Then that scenario could happen quite easily.