5 ms·
"He talks about using OOP to remove "accidental difficulty" from the process, “allowing the designer to express the essence of the design without having to expr
by mcguire 8y ago
"He talks about using OOP to remove "accidental difficulty" from the process, “allowing the designer to express the essence of the design without having to express large amounts of syntactic material that add no information content”…
"…but he stops at OOP? Makes me think that he was not very informed about functional programming, given that OOP is (1) trivial to add to functional programming languages, (2) dissed by all the greats as uninteresting – or worse."
Here's my take: OO may be a decent way of managing complexity, but it introduces a (noticably high) complexity floor that negates many of the benefits. It works very well for some things, specifically windowed guis, and less well for almost everything else. Rule of thumb: if you are modeling the "problem domain" and not the "solution domain," you are doing it wrong.
However, for better or worse, every programmer in the last 30 years has been trained on OOP; most simply cannot conceive of not using a "class" keyword. On the other hand, almost no one does OOP itself anymore. Objects, classes, are treated as a module system, which is noticably missing, or at least very limited, in most programing environments.
All problems have some level of essential complexity, although often it is lower than both the floor demanded of both the programing environment and the programmer's self esteem. (It's difficult for many to admit that what they are being asked to do is trivial, so they look for ways to make it more difficult, including introducing bizarre monstrosities into their environment.)
On the other hand, exactly no one wants to grapple in hand to hand combat with any moderately complex problem (and many problems do have sudden, steep, complexities) as Dijkstra would have preferred. Or, some problems cannot be solved in the necessary resource constraints, including the brain power of the programmer. As a result, more complexity is pushed down stream---and modern systems have very long tributaries.
So, what can ya' do?
- mpweiher 8y ago> [OO] introduces a (noticably high) complexity Hmm...I'd say Smalltalk is about as simple as things get. For anything more than a few functions/methods, you want some sort of scoping/module concept, and I think you're right that that's one way classes are used. Might as well be classes as they are lightweight, provide a convenient metaphor and other benefits. I would say that true OO programming is rare. Most I've seen in industry is scoped procedural with little to no polymorphism. Or paraphrasing Alan Kay: "Before you dismiss OO, you should at least try it once".
- marcosdumay 8y agoSmalltalk is simple. But Smalltalk doesn't help making your programs simpler - at least not as much as a powerful FP language. OOP is a convenient tool for cutting your state into smaller, independent pieces. But that can only go as far as the pieces can be independent, what for most practical domains is not very much. It also does not bring any other big benefit bundled with it, what looks to me like the EDJ complaint is all about.
- mpweiher 8y ago> But Smalltalk doesn't help making your programs simpler Hmm..."OO may be a decent way of managing complexity..." was what the parent said, I responded to the "complex baseline" assertion. And your assertion that it doesn't help is empirically invalidated on many counts. First, the folks at Xerox PARC managed to implement "Personal Computing (networked)" in around 20KLOC of Smalltalk, including the OS, windowing system, IDE, networking, e-mail, messaging etc. Second, look at the sheer amount of functionality in something like Squeak. > at least not as much as a powerful FP language. Citation needed? Caper Jones Function Point Metric puts Smalltalk's language level at 20, Haskell at 8.5 (larger=better) http://www.cs.bsu.edu/homepages/dmz/cs697/langtbl.htm http://www.cs.bsu.edu/homepages/dmz/cs697/langtbl.htm
- mcguire 8y agoIIRC, both Plan 9 and QNX are not that much larger, and they're written in C.
- hmijail 8y agoI found this interesting, so after some googling, these are the numbers I found: QNX kernel = 23 KLOC, C [1] Plan9 kernel = 50 KLOC, C [2] Squeak VM = 9 KLOC, Smalltalk [3] (Squeak is a Smalltalk) Note, those are the kernels - Smalltalk's 20 KLOC include the whole system (GUI, etc), IIRC. For clarity, I'm a bit out of my depth here, and I'm assuming that the Squeak VM is a bit akin to a kernel. And surely one could find more authoritative references for it all. [1] http://www.gelato.unsw.edu.au/IA64wiki/JamieLennox/QNXvL4?action=AttachFile&do=get&target=Jamie08.pdf#page=37 http://www.gelato.unsw.edu.au/IA64wiki/JamieLennox/QNXvL4?ac... [2] https://news.ycombinator.com/item?id=879101 https://news.ycombinator.com/item?id=879101 [3] https://books.google.com.au/books?id=FM-pCAAAQBAJ&pg=PA136&lpg=PA136&dq=squeak+system+kloc&source=bl&ots=6ELCi90mvF&sig=QyDUs81S2lEEKRYZeZxr5ZPCR0U&hl=en&sa=X&ved=2ahUKEwi1r-6j-IbdAhUXc3AKHSdzAokQ6AEwAXoECAcQAQ#v=onepage&q=squeak%20system%20kloc&f=false https://books.google.com.au/books?id=FM-pCAAAQBAJ&pg=PA136&l...
- contravariant 8y agoAssuming well defined problems have a single solution, how exactly is the solution domain different from the problem domain?
- mcguire 8y agoNo real problem has a single solution.