Live data from Hacker News

Correctness – A paradigm for sustainable software development

nonullpointers.com

131–140 of 186 posts

Re: Correctness – A paradigm for sustainable software development

#131
post #14

>The thing you need to look at if you’re using say, a dynamic language, or object oriented design, is that in the long term, what is the language and mindset of “objects” with dynamic dispatch providing you apart from an endless stream of bugs that seem to keep reoccurring everytime you try an evolve the software to introduce a new requirement? I am sick and tired of the arrogant, willfully ignorant developers toutin…

> However, large-scale systems almost always have state Managing state is a central part of what FP systems do; a normal Haskell program is, in a sense, a function that returns an imperative program for handling stateful interaction. The stateful and stateless parts are clearly distinguished so that the problems associated with state can be managed more effectively and don't make it hard to reason about parts of the…

Writing stateful code in Haskell is super clunky though. State monads and lens? - Yuck! I'd take an OO language over that mess any day.

Re: Correctness – A paradigm for sustainable software development

#132
post #38

Earlier quoted context omitted.

Not the OP, but I might have some context. I think of OOP as a message passing paradigm . It's concerned with how messages are passed from one part of the system to another. It is not particularly concerned with how those messages are implemented under the hood. In that sense it's a higher level paradigm because OOP is all about building abstractions ("objects") and defining how they communicate, rather than wiring c…

When viewed that way, you're not dealing with most mainstream OO languages anymore. But it is the intent of the originators of OO and I prefer the same view. Especially because at that point it becomes orthogonal to imperative/functional approaches. Message passing can be used with a functional language (Erlang) or an imperative language (Go) to great effect. It can also be added onto (as a library) most other langua…

l_t covered it pretty well.

>And I still don't see how message passing is a higher level paradigm than functional programming.

Speaking practically, I see a lot of modern technologies that converge (very slowly) on the same ideas Alan Kay was talking about as OOP for the last 40 years. Micro-services, web pages with JavaScript, containers, etc. Those things are pretty high-level.

Re: Correctness – A paradigm for sustainable software development

#133
post #128
post #65

Earlier quoted context omitted.

Sorry, but you're just validating my stereotype of a typical OOP critic. OOP != Java. >OOP is great if all you are doing is OO and if your solution to a problem is running a simulation (what OOP was invented for). Most problems most programmers solve are simulation in some sense. Including DevOps. I wish larger number of people realized this. Things would become much simpler. The problem with class-oriented languages…

You arguments are all nice and dandy - but who uses OOP like this? And you still have the state being all over the place problem. I think I made it clear that OOP is fine if you can afford to live in that space. In practice you often can't. Re the boundary problem: Sending objects over wire doesn't solve it at all, it makes it worse. Object identity for once and incompatible classes between client/server. Hiding data…

>Hiding data in magic objects just doesn't work.

Works fine for billions of web pages that run JavaScript.

Re: Correctness – A paradigm for sustainable software development

#134
post #14

>The thing you need to look at if you’re using say, a dynamic language, or object oriented design, is that in the long term, what is the language and mindset of “objects” with dynamic dispatch providing you apart from an endless stream of bugs that seem to keep reoccurring everytime you try an evolve the software to introduce a new requirement? I am sick and tired of the arrogant, willfully ignorant developers toutin…

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?

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 development

#135
post #38

Earlier quoted context omitted.

> 1. OOP is a higher-level paradigm than FP , so people comparing them directly usually are missing the point to begin with. [emphasis added] How so?

Not the OP, but I might have some context. I think of OOP as a message passing paradigm . It's concerned with how messages are passed from one part of the system to another. It is not particularly concerned with how those messages are implemented under the hood. In that sense it's a higher level paradigm because OOP is all about building abstractions ("objects") and defining how they communicate, rather than wiring c…

You don't think type classes and higher order functions are concerned with abstractions?

Re: Correctness – A paradigm for sustainable software development

#136

I've been thinking about this subject for a while and been on the verge of writing about it. The thing is, I've come to the opposite conclusion. My conclusion is that programmers have been trained to think about correctness. What they should be trained on and design is to account for inevitable failures. My main paradigm is the floating point design. It incorporates a built-in invalid value, which neatly propagates i…

You are more or less describing a monad

Re: Correctness – A paradigm for sustainable software development

#137
post #131

Earlier quoted context omitted.

> However, large-scale systems almost always have state Managing state is a central part of what FP systems do; a normal Haskell program is, in a sense, a function that returns an imperative program for handling stateful interaction. The stateful and stateless parts are clearly distinguished so that the problems associated with state can be managed more effectively and don't make it hard to reason about parts of the…

Writing stateful code in Haskell is super clunky though. State monads and lens? - Yuck! I'd take an OO language over that mess any day.

State Monads and lens are just libraries though, and only one of many ways to deal with stateful code in Haskell.

OOP, on the other hand, is clunky as a concept...

Re: Correctness – A paradigm for sustainable software development

#138

Earlier quoted context omitted.

In the vast majority of OOP language, the object allows one to do virtually anything behind the scenes with a bit of construction (plus of course functional programming is opinionated. There are a whole variety of definitely bad practices an FP programmer will point to as being disallowed by the FP). See: "Closures And Objects Are Equivalent" etc. http://wiki.c2.com/?ClosuresAndObjectsAreEquivalent And https://stacko…

Yes, because those objects are a fusion of OOP and ADTs. Pure OOP does not permit violating procedural abstraction. To summarise, FP provides good reasoning in the small, and OO is needed in the large to orchestrate stateful services via protocols.

The paper that you're citing claims that "pure OOP" means "An object can only access other objects through their public interfaces". This feels like a very arbitrary definition to me, and one that does not correspond to what we deem OOP colloquially. Conversely, if the problem is "pure OOP", but most OOP that we actually use isn't "pure", then there's no problem.

Re: Correctness – A paradigm for sustainable software development

#139
post #37
post #14

>The thing you need to look at if you’re using say, a dynamic language, or object oriented design, is that in the long term, what is the language and mindset of “objects” with dynamic dispatch providing you apart from an endless stream of bugs that seem to keep reoccurring everytime you try an evolve the software to introduce a new requirement? I am sick and tired of the arrogant, willfully ignorant developers toutin…

To add more specific examples. If you want to understand OOP idea do not think about Java/C# classes and inheritance. Think about OS processes/IPC or microservices. These are Objects. This is the basic idea behind OOP. Getter/setter is the main anti-pattern of OOP design.

By this definition, neither Simula nor Smalltalk were object-oriented, which doesn't make much sense to me.

Re: Correctness – A paradigm for sustainable software development

#140

> what is the language and mindset of “objects” with dynamic dispatch providing you apart from an endless stream of bugs that seem to keep reoccurring everytime you try an evolve the software to introduce a new requirement? The only mindset required to avoid long-term bugs and maintenance problems is a personal conscientiousness, a personal approach to defensive programming based on (ideally, extensive) personal expe…

This makes a whole lot of sense to me. However, one of the elements of truly productive learning is _focused_ practice; that is, practice with mindfulness and intentionality directed at a specific element. One won't necessarily get any better at decoupling unless it is specifically practiced. To that end, _how_ would one truly practice the skill of decoupling? Or maybe, what resources or heuristics or strategies would you suggest to help draw the lines between behaviours or modules?

The first thing that comes to mind is Gary Bernhardt's talk on Boundaries, or "functional core, imperative shell", but I'm not sure that this is entirely what you're discussing here.

Post reply on HN