News for hackers. Stuff that matters.
Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by robert_tweed on Sunday November 30, 2014 @02:44PM (#8677819)
A lot of the recent trend towards OOP-bashing comes from bad implementations of OOP, just as bashing design patterns is more to do with badly thought out architectures and overuse of those patterns.

In fact, the origins of OOP are basically what we would now call microservice architecture (CSP-inspired languages like Go being a specialisation of this). Each service can be as stateless or as stateful as it needs to be (without shared state) and services should be loosely coupled.

That's quite different to most large-scale OOP architectures, but it is possible to code in that style in any OOP language.

Heavy reliance on inheritance for code reuse is a whole problem class in itself that again has little to do with OOP and lots to do with the influence of C++.

Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by trhway on Monday December 01, 2014 @01:15AM (#8679770)
>A lot of the recent trend towards OOP-bashing comes from bad implementations of OOP, just as bashing design patterns is more to do with badly thought out architectures and overuse of those patterns.

sorry, but this is no true Scotsman fallacy. All these "bad implementations" is OOP, real OOP, not some idealized ephemeral non-existent Avalon. If an idea easily and more frequently than not lands itself to the bad implementations then there is something wrong with the idea. (I happen to come from a country which was pursuing what was looking like a pretty good idea - communism - which has got a lot of bashing during recent decades, due to "bad implementations" i guess, and as result it was critically rethought and now we know what it is not a good idea really)

Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by alan82 on Sunday November 30, 2014 @03:37PM (#8677997)
In sports, training coaches sometimes forbid to use some play element. In OOP classes there should be an assignment to design a system without inheritance. Just to show what is most important in OOP.
Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by Jare on Sunday November 30, 2014 @05:24PM (#8678412)
I was taught OOP using Modula-2 in 1989, by defining structures and functions that took a pointer to the struct as first parameter. No inheritance goodies! I used that style in C until 1996 when I definitely moved to C++. Probably why I am not terribly dismissive of OOP but very much of things like inheritance trees, the Java OOP style, and the overuse of GoF in architecture, literature and especially programming discussions.
Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by thewarrior on Sunday November 30, 2014 @11:35PM (#8679515)
How would you design something like :

Person --> Full Time Employee --> Manager

Person --> Contract Employee

Without inheritance assuming that salary calculation is the only thing which differentiates them.

Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by derefr on Sunday November 30, 2014 @11:48PM (#8679549)
Something like...

   Person HAS A IEmploymentRelationship
   ContractEmployment IMPLEMENTS IEmploymentRelationship
   FullTimeEmployment IMPLEMENTS IEmploymentRelationship
   FullTimeEmployment HAS A IDirectReport
   Manager HAS A Person
   Manager IMPLEMENTS IDirectReport
And then salary() is a polymorphic function declared by the IEmploymentRelationship interface, where FullTimeEmployment instances use the manager somehow, and ContractEmployment doesn't.

You can even put some sugar on that by having a salary() function on Person that calls the salary() function on its IEmploymentRelationship—but I wouldn't, for the same reason I wouldn't denormalize a relational database.

Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by thewarrior on Monday December 01, 2014 @12:04AM (#8679592)
Got it. Thank you.
Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by vince_refiti on Sunday November 30, 2014 @09:57PM (#8679273)
In Ada, I remember reading that you can limit the inheritance depth.
Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by tailrecursion on Sunday November 30, 2014 @04:43PM (#8678237)
If we redefine the word "OOP:object" to mean process-with-mailbox, and redefine the word "OOP:message" to mean asynchronous message passing, then objects and messages make sense and are useful.

Those are not Smalltalk's definitions -- even though I think you're right on about Alan Kay's original inspiration -- and confusion can arise if we redefine terms.

Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by archagon on Sunday November 30, 2014 @03:32PM (#8677976)
It seems to me that you can't really do message passing in most languages with high efficiency? (Objective-C and Swift being the exceptions.)
Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by rurban on Sunday November 30, 2014 @05:43PM (#8678496)
Rather the opposite. Almost all HPC (high-performance computing) systems use message passing and not shared memory. The fastest and imho best unix-like kernel L4 is entirely MP based.

So if you want to embrace high performance (and concurrent), go message passing. Alan Kay's favor of late binding does not help performance, as method lookup at run-time dominates the cost then, but the fast systems are early bound, i.e. typed.

Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by seanmcdirmid on Sunday November 30, 2014 @06:59PM (#8678783)
Well, you are discounting CUDA, which has been seen as suited for many tasks when compared to MPI. Of course, you can use MPI and CUDA together (people are working on that), which you then have messaging between nodes and shared memory (via GPU-style SIMD) within.

Of course, you are probably referring to NUMA, but people still actually use that.

Pure OO isn't very much desired in the HPC world, but then neither is pure FP.

Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by Joeri on Sunday November 30, 2014 @04:25PM (#8678160)
I think it's a bit charitable to call what Objective C does to be "message passing". The messages are not asynchronous and have only a single recipient, so in practice I would say they're method calls with late binding.
Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by mpweiher on Monday December 01, 2014 @12:11AM (#8679615)
However, they can easily be made asynchronous and address multiple recipients. See Higher Order Messaging[1][2], first implemented in Objective-C[3]. So for example:

    [[myView onMainThread] setNeedsDisplay:YES];

    result = [[someObject future] someMessage:arg];

    combined = [[prefixes collect] stringByAppendingString:[suffixes each]];
The reason this is easy in Objective-C is because its brand of message passing is just (barely) powerful enough to qualify as message passing. In fact, if you squint just a little, you can see it as fully reified message passing with the common-case (a synchronous method is invoked) optimized.

[1] http://en.wikipedia.org/wiki/Higher_order_message

[2] http://www.metaobject.com/papers/Higher_Order_Messaging_OOPS...

[3] https://github.com/mpw/MPWFoundation

Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by xsmasher on Monday December 01, 2014 @12:39AM (#8679689)
At least you can redirect messages to another recipient, and write a handler for "unhandled messages." Impossible with c++, at least with standard method calls.
Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by archagon on Sunday November 30, 2014 @05:45PM (#8678505)
You can do one-to-many messages via notifications, though it's less elegant.
Re:Alan Kay on the Meaning of “Object-Oriented Programming” ... by rumcajz on Monday December 01, 2014 @01:11AM (#8679761)
Alan Kay may have coined the term, but OOP (as any other word or term) is what people believe it to be. Which is pretty far from CSP.