Hacker News new | past | comments | ask | show | jobs | submit login

Voted this up out of pure nostalgia. I remember the "spirited" usenet discussions we had with topmind/tablizer on comp.object. He was a one-man army fighting proponents of OO. There were actually some decent ideas buried in his ramblings about table-oriented programming but he was so abrasive nobody could deal with him. I'd be curious what became of him...



I remember him from the late 1990s, I think. One of the various usenet weirdos I have somewhat fond memories of reading at the time. "Wow, who the hell were those freaks", I'd think, as I left a computer room at university, blinking at the sunlight (since the room I'd usually go to, on account of its good-sized set of underused HP9000s, had slightly dim lighting and zero windows), having just spent half a day of one of what would have been potentially the better years of my life reading what these people had to say. How could they find the time, I'd wonder. Didn't they have anything better to do? ;)

Still fascinating though. Usenet was like a crash course in seeing how people can be dicks. Still can't decide whether I regret it or not.


By late 90s, eternal september had set in. Meaning that anyone with AOL access could access usenet. the net has likely never recovered.


I REMEMBER THAT. I was in my early 20s and Usernet went from heaven to hell in about 6 months. AOL AND NetTV consoles.

Room titles went from Nerd/Hacker/CS to Single Meetup rooms, PR0N and Music topics. I left maybe just in time and moved to IRC (A-Net was also HELL the 4-chan Grandfather)????


I think topmind/tablizer has been somewhat vindicated with the rise of Clojure and Rich Hickey ranting on OO in a much more eloquent way.

But generally, I think the glow of OO as some kind of awesome panacea for software development woes has worn off. Or at the very least, the way it was sold back in the 90s has been pretty much debunked.


When I saw the headline I immediately thought of http://c2.com/cgi/wiki?TopMind


Me too. I binged a lot of the C2 wiki last year and waded through a lot of his spew.


My first thought was, sharing is tables


I remember him as well, he didn't understand OO well enough to critique it so very little of what he said had any actual value. "Spirited" is a nice way to put it, a bit colored by nostalgia though. His idea of programming is a big ball of procedural mud over a relational database where every task is a hand written sql query/loop over result set, fucking terrible.


Many integrated CRUD apps are best written as procedures (call them REST endpoints if you prefer) that (ultimately) use SQL queries to update a store of facts. In a heterogeneous world, the idea that you have an authoritative model defined in any one language, that merely uses the database for persistence, is untenable. Objects with hidden state are a poor way to model facts about the world.

Having been a follower of OOP since the early 90s until my disillusionment in the mid 00s, to my mind only a handful of problem domains are best modelled as interacting graphs of mutable objects, and the set grows smaller over time. I'm increasingly unconvinced that procedures+SQL done well is inferior to the average developer's OOP code. And if OOP hasn't delivered that kind of mental leverage, then it's mostly a sham.

(I should add that I'm far more inclined to try and model things functionally, with functions that turn input into a set of logical diffs rather than straight-up database modifications, than actually advocate all-out procedural programming with raw SQL. But even raw SQL is superior to effectively performing complex queries in a non-relational language, where the indexes are built by hand and passed around.)


Sure, but the world is bigger than CRUD apps, and even in CRUD apps, object mapping is more productive than hand written SQL slinging result sets around in procedural code. In particular the ease at which OO enabled pluggable programs is invaluable in customizing in different ways for different clients or aggregating data from multiple sources. OO isn't about modeling facts about the world, it's about modelling behavior; objects aren't just structs with some data.

> But even raw SQL is superior to effectively performing complex queries in a non-relational language, where the indexes are built by hand and passed around.

I think that's a bit of a strawman, that's not what OO is.

> In a heterogeneous world, the idea that you have an authoritative model defined in any one language, that merely uses the database for persistence, is untenable.

That's not what OO is either.


CRUD apps are mostly about synchronizing a set of facts about the world with the world itself.

Re complex queries in a non-relational language: I know that's not what OO is, but if you're trying to perform a map / filter / aggregate operation across several different collections (sometimes these kinds of things need to be done!), OO doesn't give you many tools, and the tools you can build are usually poor versions of what's available in functional languages, which are themselves less specialized and less declarative than relational languages.

If you can represent your problem as a map/filter/aggregate operation, it (a) becomes more testable, (b) more parallelizable in both large and small and (c) more composable. I happen to think it ends up being easier to read, write and reason about too. So I try hard to make my problems look like this, because I know the tools in that area are very strong.

Objects being more than structs with immutable data is exactly what's wrong with them. OO encourages you to reason about behaviour in terms of invariants: what's true before vs what's true after, or what is always true for an instance. I think that's strictly inferior to reasoning by transformation: what is the input vs what is the output. In particular, I think functional transformation is more composable than invariants. I'd feel happier about OO and its implicit invariants if they were made more explicit, and more than just like Eiffel: it needs to be in the type system, if possible.


> CRUD apps are mostly about synchronizing facts about the world with the world itself.

Yes, but as already stated, the world is bigger than CRUD apps and a big collection of facts about the world isn't very useful without any behavior attached to those facts. Once behavior is involved, OO becomes useful.

> but if you're trying to perform a map / filter / aggregate operation across several different collections (sometimes these kinds of things need to be done!), OO doesn't give you many tools

As those things are completely orthogonal to OO, so what? You can perfectly well use the database to do the map/filter/querying and still have an OO program; OO has nothing to do with map/filter/querying, so as I said already, this is a strawman.

> Objects being more than structs with immutable data is exactly what's wrong with them.

No, it's exactly what's right with them. It is the very reason they exist, it's entirely the point of OO to hide data and expose behavior instead through a message based interface. Structs aren't objects, so claiming objects being more than structs is what's wrong them is to claim that objects shouldn't exist and that claim is unsupportable.

> I think that's strictly inferior to reasoning by transformation: what is the input vs what is the output. In particular, I think functional transformation is more composable than invariants.

Functional programming is great, and mixes quite well with OO, but it's not what's being discussed, we're comparing OO to procedural programming as implemented by topmind and his table oriented programming here.

Both of your replies are strawmen, you cast objects as data and then complain that they're bad at being data: but objects aren't about data, they're about pluggable behavior as I've already said. You have to step outside the "data is everything" mindset to actually see what OO is and where its value lies.

Frankly you don't give me the impression than you actually understand object oriented programming, like topmind himself, you seem to be full of misconceptions related to an inability to step outside the "it's all data" mindset. I could be wrong, but that's the impression you're leaving.

Take a basic example from a simple CRUD app; say I'm selling a CRUD app to many businesses, many of which already have corporate websites with global login systems and they want my app to use their member database and login system. The solution is simple and obvious, make my authentication system pluggable and for each big client that's worth the effort, implement a custom login provider that ties my authentication into their existing systems API. Can you describe a nice scalable procedural solution to this problem that's better than the obvious OO solution?


I think you're more interested in interfaces than objects, actually. All the problems of objects - inheritance most especially, but mutable state too - aren't relevant if you're primarily interested in "pluggable behaviour", which really is an interface-oriented mindset, not an OO one.

You can certainly go very far with interfaces, as both COM and HTTP have shown. Neither are object oriented, but both abstract away implementation details to compose behaviour. How HTTP has evolved and succeeded compared to COM shows the relative strengths and weaknesses: such pluggable behaviour works best when composing larger systems, rather than in the small, at the level of implementation details. That's exactly where OO is poor.

I will still contend that a cyclic graph of mutable objects (whether they look like message-passing interfaces or not) makes for a very marshy foundation. The reason is mutability and lack of idempotence. These are critical to why functional is a better approach compared to OO. To the degree that interfaces expose mutability, and they are composed in large enough mass, the same problems as OO will arise. There's a reason I keep harping on about mutability despite accusations of straw men: it is the fundamental flaw at the heart of OO.

> Functional programming is great, and mixes quite well with OO

It does not. You have to work very hard in most OO languages to get FP right; in statically typed languages, the type system isn't expressive enough, and most dynamically typed languages default to too much mutability.

There was a chap back in the day who advocated object-oriented assembly, Randall Hyde. The discipline required reminds me of attempts to do FP in an OO language. The minimum needed for FP in OO is a decent lambda syntax (do you remember the horrible gymnastics with overloaded operators in C++ before lambdas? - boost::lambda etc); without that, it's not worth the syntactic overhead. With it, something can be accomplished. But nominal typing really sucks, and OO programmers love giving their types distinct names, explicitly preventing the reuse they allegedly are after.

From several decades of observation, I have a theory that OOP programmers get caught up in a reward feedback loop around ceremony and prefabricated patterns, a quasi-religious endorphin rush from following formalisms that aren't strictly necessary to address the problem head-on. When a programmer isn't particularly good at crafting good solutions but can follow the OOP idioms, they can create a lot of stuff fairly quickly that looks like work, and if it fits together nicely it seems like it's elegant. But it's like carpentry focused on the joins instead of the structure: at risk of becoming baroque and unstable.

Good developers can write good OO code, of course - good developers can write good code in any language. But I don't know of anything else with the same power to clarify thinking than functional composition - it levers the mind with a solid tool rather than a wobbly, lashed-together one. And objects compose to make wholes that are less stable than their parts - because they are mutable, and state spaces multiply. Mutability is always the problem in the end.


I'm going to start with a few definitions because I can see we're not using the same ones.

Functional programming: programming in a style where functions are the basic building blocks of the program and are passed around as data to other functions along with raw data, i.e. Lisp, Scheme, Haskell. (note, functional languages are not necessarily immutable).

Pure functional programming: programming in a functional style as above, with the additional insistence on not allowing mutable state at all. i.e. (no language is truly pure because side effects are a must, but Haskell comes close).

Object oriented Programming: programming in a style where objects are the basic building blocks of the program with 3 basic features, late binding, encapsulation, and polymorphism allowing the hiding of raw data behind a message passing interface so that the program is centered around object behavior rather than object data. (note neither classes nor inheritance are necessary features of OO systems, they are simply common features).

> I think you're more interested in interfaces than objects, actually. All the problems of objects - inheritance most especially, but mutable state too - aren't relevant if you're primarily interested in "pluggable behaviour", which really is an interface-oriented mindset, not an OO one.

That's a bit of a misunderstanding of both interfaces and OO. Firstly, interfaces simply define what an object looks like, it's an implementation detail and has nothing to do with OO in general. The same applies to inheritance. Inheritance is simply one means of code sharing and is not a necessary feature of an OO system, neither Self nor Javascript for example, have inheritance in their object systems. One can also build a system that is entirely object oriented without once using an inheritance hierarchy once. Code can be shared via delegation rather than inheritance.

> You can certainly go very far with interfaces, as both COM and HTTP have shown. Neither are object oriented

Again, I think you're incorrect, COM stands for Component Object Model, and most certainly is object oriented. An HTTP endpoint that supports GET/SET/PUT/DELETE is merely an object that has 4 standardized methods, it supports late binding, implementation hiding, and polymorphism, the primary features desired from any object system. Each endpoint is an object that accepts 4 messages. It doesn't have to be an instance of a class to be an object.

> I will still contend that a cyclic graph of mutable objects (whether they look like message-passing interfaces or not) makes for a very marshy foundation. The reason is mutability and lack of idempotence.

Neither of those have anything to do with OO; you can have an OO system of entirely immutable objects. Again, you're critiquing implementation details of systems you've seen that use objects and then blame objects for features those systems have that have nothing to with with OO. Just because an OO system does something bad, doesn't mean it's OO itself that is the issue.

> There's a reason I keep harping on about mutability despite accusations of straw men: it is the fundamental flaw at the heart of OO.

No, it isn't, because mutability isn't at the heart of OO. While it's perfectly valid from a functional perspective to critique mutability, it does not follow that said critique applies to OO in general. Objects do not have to be mutable, while it's common for OO systems to be mutable, what makes an OO system is not the mutability. This is again a strawman, you mean to critique mutability, not OO, they are simply orthogonal.

One of the most useful objects in systems I work on is the Money object; it's immutable, it's treated as a primitive, it's easy to reason about and won't allow things like adding different currencies together or dividing and losing pennies. Object systems contain many such objects, another one is String. Now String... well that's a very used and very useful object with a bazillions little methods on it that return new instances of String that look differently like .ToTitleCase()... again, pure OO, no mutability in sight.

> It does not.

You're mistaken, Smalltalk the language is an elegant mix of OO and functional programming. Functions are passed around to higher order functions to do work in virtually all parts of the system and nearly all standard idioms use such higher order functional programming. Here, I think you're confusing functional programming style with immutable functional programming, they are not the same thing. Lisp is a functional programming language and everything is mutable. Functional does not mean immutable.

> You have to work very hard in most OO languages to get FP right; in statically typed languages, the type system isn't expressive enough, and most dynamically typed languages default to too much mutability.

Immutability is an implementation detail of some functional programming languages, it is not a requirement. The discussion about immutability vs mutability applies to all programming paradigms and is simply orthogonal to the OO vs procedural vs functional debate.

> From several decades of observation, I have a theory that OOP programmers get caught up in a reward feedback loop around ceremony and prefabricated patterns, a quasi-religious endorphin rush from following formalisms that aren't strictly necessary to address the problem head-on.

On that we agree, but those are just bad programmers; their failures are not a critique of the OOP style itself.

> But I don't know of anything else with the same power to clarify thinking than functional composition - it levers the mind with a solid tool rather than a wobbly, lashed-together one.

I agree, but this has little to do with OO, and more to do with referential transparency. Yes, pure functions are easier to reason about than methods who depend on hidden internal state. But objects can be useful without any state at all. Smalltalk implements its conditional statements using polymorphic objects True and False, both subclasses of Boolean, and none of these classes have any state at all; their identity alone is all that is needed to implement the entirety of boolean logic purely in the library, i.e. Smalltalk has no procedural constructs like an if statement or a while statement or a for or foreach statement; it's all done with functional programming and objects.

> And objects compose to make wholes that are less stable than their parts - because they are mutable, and state spaces multiply. Mutability is always the problem in the end.

Again, since one can build a perfectly OO system out of entirely immutable objects, then obviously this critique again misses the mark and blames OO for something that simply isn't an OO thing. Yes, most OO systems have mutable state, that's an implementation choice those programmers made, they didn't have to, but they chose mutability. Your critique is against mutability, not against OO.


Hey man, accidentally downvoted this comment but I agree heartily. In fact, if you're interested in the approach you describe at the end of your comments, you should read about "event sourcing", CQRS, Redux, Apache Samza, Elm, and re-frame.


> only a handful of problem domains are best modelled as interacting graphs of mutable objects, and the set grows smaller over time.

Indeed, the CRUD service itself is an OO interface (send it GET/POST messages to an endpoint). How that's implemented behind that need not be OO.


And arguably that's the biggest problem with the modern web: the non-idempotence of GET in a world with PUT (and POST).


Would that make C functions OO?


IMO, OOP sounds nice but frankly we humans work in procedural ways.

Everything from farming on up can be described as "first we do X then we do Y".


That something can be described in a procedural manner does not imply we humans work that way, nor does it preclude the fact the those same things can be described in other manners as well.

When you interact with other people, you do it the OO way, you send them a message and they either act on it or not depending on their own internal state with different people able to respond differently to the same set of messages; I can just as easily claim we humans work in OO ways.

Beyond that, it's easier to describe a sequence of steps in OO where the implementation details can be hidden and swapped out with different implementations than in procedures where the logic and implementation are all mixed together and tightly coupled.


That seems like a very different definition of OO than i am used to seeing.


What you're used to seeing might be better described as "class-oriented programming", i.e. Java's take on OOP. Once you realize that `this` is just an implicit parameter and objects are just closures (look at Javascript's OOP for a good illustration of this principle), and you start to think about how objects can interact reliably across interfaces/languages/networks/failures, you more-or-less inevitably end up at "message-oriented programming", i.e. Smalltalk's take on OOP, wrapped up in declarative/functional APIs.

Disclaimer: these ideas are all unoriginal and some of them directly borrowed from other commenters in this thread.


All this makes unix core tools and shell scripts sound OO.


Not really, they're more functional, they have textual input and output, and can be chained together, but they don't really trade meaningful messages back and forth. Processes can be thought of as objects, and signals as messages, but the set is not extensible while OO allows the developer to define the messages.


What definition are you used to seeing? I'm a Smalltalk'er, OO has been since its creation, about objects communicating via messages while hiding their implementation details so different implementations can be swapped in, i.e. late binding, polymorphism, and encapsulation, that's rather the entire point of OO.


C++ and similar.


C++ was C with objects bolted on badly, it'd be hard to point to a worse Object Oriented language. Smalltalk is what OO was intended to be, everything else is a bad copy.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: