News for hackers. Stuff that matters.
Re:Correctness – A paradigm for sustainable software develop... by thraway-burnout on Friday April 05, 2019 @11:52AM (#19583734)
This is a bit like the "Islam is a religion of peace" discourse. I'm sure it is, but:

OOP as actually implemented and found in the wild isn't about Smalltalk or message passing. It's about transforming functions into methods by unnecessarily wrapping behaviour in classes, as an example of cargo-cult programming.

OOP the idea is great. How do you actually find it in the world?

Re:Correctness – A paradigm for sustainable software develop... by depressed on Friday April 05, 2019 @11:56AM (#19583774)
If functional programming were implemented as widely and abused as much as OOP is, would it really fare any better?
Re:Correctness – A paradigm for sustainable software develop... by ummonk on Friday April 05, 2019 @01:49PM (#19585210)
You can already see examples of this.

Take callback hell. Opaque callbacks are the functional equivalent of goto statements.

Also, many functional programmers, particularly Haskell programmers, seem not to care about readability and maintainability. They're focused on maximizing their own productivity as an individual coder, and writing cool concise and abstracted code that might not actually be easy for another engineer to understand and modify.

The difference though is that good functional programming is still quite common whereas good object oriented programming seems to be rare (the one exception being microservices).

Re:Correctness – A paradigm for sustainable software develop... by marmaduke on Friday April 05, 2019 @07:59PM (#19588198)
> Opaque callbacks are the functional equivalent of goto statements

in some sense they are worse because you can't just grep for the call site of an anonymous closure, like you can for a goto, it could be almost anywhere in the code base

Re:Correctness – A paradigm for sustainable software develop... by axlprose on Friday April 05, 2019 @03:34PM (#19586184)
>particularly Haskell programmers, seem not to care about readability and maintainability

Say what you want about the foreign-ness of the syntax, but Haskell code is some of the most maintainable code out there. I can often times dive into another person's haskell code and grok it more easily than the equivalent code in a "friendlier" language like python or ruby, nevermind a more comparable language like scala. Haskell is also a breeze to refactor, the compiler and type system make changing and moving arbitrary chunks of code around pretty straight-forward, even when the code is using abstractions you're not familiar with; something which cannot be said for many other languages. The biggest downside to haskell (apart from the learning curve) is having to deal with cabal+stack.

Re:Correctness – A paradigm for sustainable software develop... by slx26 on Friday April 05, 2019 @12:06PM (#19583875)
exactly, I feel the same way. OOP is often criticised from functional programming, but also from data-driven programming, for example. You never hear functional programming advocates criticise data-driven programming. The use cases are so different that it wouldn't make sense.

To use OOP properly is probably as complicated as doing functional programming or data-driven programming properly. The "problem" is that the learning curve is much less steep and the use-cases more extense, so obviously there's a lot more people misusing it.

Re:Correctness – A paradigm for sustainable software develop... by blattimwind on Friday April 05, 2019 @12:42PM (#19584364)
I've seen data-driven code and it is full of OOP. Those are hardly orthogonal concepts. Arguably DD (on the pedal to the metal C/C++ level) doesn't quite match the OOP choir in terms of looks.
Re:Correctness – A paradigm for sustainable software develop... by slx26 on Friday April 05, 2019 @05:07PM (#19587057)
I totally agree, and I believe any serious programmer should have at least some basic knowledge of the three "paradigms", as the core concepts are relevant in all cases, and there are many techniques that can be applied in different "paradigms". I didn't start talking about it in order to keep the comment short, but maybe it was a bit confusing.
Re:Correctness – A paradigm for sustainable software develop... by myWindoonn on Friday April 05, 2019 @10:33PM (#19588805)
E [0] doesn't have classes or inheritance. It has messages and message-passing, and objects are genuinely encapsulated.

A cousin comment notes that true objects are often called "actors". This is fine, but people who do this without an understanding of this history may come to miss out entirely on objects, only seeing what Erlang and Elm have to offer and not E.

As a hint, try removing the meme entirely from your inventory for a bit: For the next week, whenever you think or say "object-oriented", interrupt yourself and instead think about what specific language feature, be it classes or inheritance or whatever, you actually wanted to reference.

[0] http://erights.org/

Re:Correctness – A paradigm for sustainable software develop... by psgibbs on Friday April 05, 2019 @12:08PM (#19583893)
I've seen plenty of junior engineers who read a FP blog post, and start arguing about 'purity' and the need to refactor lots of code – without having any clue that pure functions are useful regardless of other coding paradigms / architectural decisions.
Re:Correctness – A paradigm for sustainable software develop... by spronkey on Friday April 12, 2019 @09:22AM (#19644538)
I'm very much in OOP-land when it comes to architecture at large, but a good portion of my code these days could be summarised as: using a 'classic' OO language to namespace pure functions.
Re:Correctness – A paradigm for sustainable software develop... by blattimwind on Friday April 05, 2019 @12:40PM (#19584337)
> How do you actually find it in the world?

It works. It is a sufficiently good model for many domains, even though it obviously is "impure" by combining the domain model and generally a whole lot of implementation details nee requirements.

It clearly is an unreasonably effective strategy that has no solid theoretical footing, yet that does not prevent it from working in practice.

Re:Correctness – A paradigm for sustainable software develop... by abdulhaq on Friday April 05, 2019 @02:32PM (#19585637)
If you're unclear on who is peaceful and who is aggressive, take a look at whose army is in whose country.