5 ms·
“OOP” is one of those terms (like most terms) that have a narrow meaning and a broad meaning, and either proponents or detractors can use one of them in argumen
by svat 6y ago
“OOP” is one of those terms (like most terms) that have a narrow meaning and a broad meaning, and either proponents or detractors can use one of them in arguments:
• OOP, narrow sense (emphasis on “object”): data-with-associated-functions, encapsulation, etc.
• OOP, broad sense (emphasis on “oriented”): organizing your program around objects that model the nouns in the problem domain, “everything is an object”.
A (satirical) illustration of the latter is in the first few paragraphs of https://caseymuratori.com/blog_0015 https://caseymuratori.com/blog_0015 (from 2014), which gives an example where, to write a payroll system, you first start by designing classes for “Employee”, “Manager”, etc.
A (non-satirical) illustration is in the infamous “TDD Sudoku” series of blog posts (follow the links from http://ravimohan.blogspot.com/2007/04/learning-from-sudoku-solvers.html http://ravimohan.blogspot.com/2007/04/learning-from-sudoku-s... or https://news.ycombinator.com/item?id=3033446 https://news.ycombinator.com/item?id=3033446) where (in contrast to Norvig's program which just solves the problem) the TDD/OOP proponent ends up with a “class Game”, “class Grid”, “class Cell”, “class CellGroup” (with derived classes “Row”, “Column”, and “Square”), but ends up nowhere. (From Seibel's post: “…got fixated on the problem of how to represent a Sudoku board. […] basically wandered around for the rest of his five blog postings fiddling with the representation, making it more “object oriented” and then fixing up the tests to work with the new representation and so on until eventually, it seems, he just got bored and gave up, having made only one minor stab at the problem”.)
I think we can agree that this sort of object oriented programming can hurt a lot (thinking about objects is not a substitute for solving your problems, though it is tempting), while objects themselves are useful.
- cardiffspaceman 6y agoPeople like taxonomies, grouping things into clades of clades.
- rtomayko 6y agoI’ve seen this referred to as “satisfying your inner Linnaeus“ and have spent way too much time in that weird place myself.
- jmchuster 6y ago> I'm sorry that I long ago coined the term "objects" for this topic because it gets many people to focus on the lesser idea. > The big idea is "messaging" - that is what the kernal of Smalltalk/Squeak is all about (and it's something that was never quite completed in our Xerox PARC phase). The Japanese have a small word - ma - for "that which is in between" - perhaps the nearest English equivalent is "interstitial". The key in making great and growable systems is much more to design how its modules communicate rather than what their internal properties and behaviors should be. https://wiki.c2.com/?AlanKaysDefinitionOfObjectOriented https://wiki.c2.com/?AlanKaysDefinitionOfObjectOriented
- svat 6y agoWell, regarding that quote (interesting no doubt), see some important caveats at https://www.hillelwayne.com/post/alan-kay/ https://www.hillelwayne.com/post/alan-kay/ which goes into some detail on evolving views about OOP (including that quote). It turns out that Alan Kay did not coin the term “objects”, though he did coin “object-oriented programming”, but even in Smalltalk, messages were only one idea of three: the post concludes that “OOP consisted of three major ideas: classes that defined protocol and implementation, objects as instances of classes, and messages as the means of communication.”
- a1369209993 6y ago> one of those terms (like most terms) that have a narrow meaning and a broad meaning Very relevant: http://slatestarcodex.com/2014/11/03/all-in-all-another-brick-in-the-motte/ http://slatestarcodex.com/2014/11/03/all-in-all-another-bric...
- dingoegret 6y agoBest answer so far.