9 ms·
I've read at least a dozen papers on the history of OO, not to mention books and papers on current practices. This is what I came up with. I made what I think i
by jamesgolick 14y ago
I've read at least a dozen papers on the history of OO, not to mention books and papers on current practices. This is what I came up with. I made what I think is a pretty coherent argument for why in the article. I'd love to hear your refutation of the points I made in there.
- stiff 14y agoYou have to think a bit more about what OO really is about. How would properties of your solution differ if you instead of classes split all the code into many very small global methods? The essence of OO is objects freely passing messages between themselves, if you fix all the message routing and put it in a central place you are not doing OO anymore, you loose the most fundamental properties, for example: http://en.wikipedia.org/wiki/Dynamic_dispatch http://en.wikipedia.org/wiki/Dynamic_dispatch You also don't have encapsulation anymore, since to be able to perform the majority of the work in the services, the services have to operate directly on data owned by other objects. How can you combine the policies in ways other than a simple logical AND? How do you combine services? Others have also already pointed out other issues. Please don't be offended by the above. Software engineering is unfortunately a field where some valuable content is buried underneath loads of BS, since it is so easy to "philosophize" about it even with just basic programming experience and this leads other people learning the field to easy misconceptions. I do not want to discredit the work you put into this and it might be that in some form something valuable will come from some of the ideas. It is an interesting problem to work on and for me it was an interesting solution to think about, I just don't think you are there yet.
- jamesgolick 14y ago> You have to think a bit more about what OO really is about. If you want to have a respectful debate, I'm completely game. If you'd prefer to continue with your incredibly condescending tone, then I'll bow out here.
- ryeguy 14y agoYou need to grow thicker skin, that first sentence was in no way condescending and gives you no reason to just ignore the rest of his comment.
- telemachos 14y agoNo. It may be unintentional, but the tone of stiff's comments is highly condescending. Exhibit A: Whatever you think about James's choices in this library, he has clearly thought a lot about OOP. It's just silly to start a comment with "You have to think a bit more about what OO really is about."
- phillmv 14y ago>You need to grow thicker skin I'm beginning to be convinced this is almost never an appropriate thing to say.
- stiff 14y agoWell, maybe I got carried away a bit with the tone in general in the last paragraphs of both comments, but I think I substantiated the particular sentence you cited quite a bit. On the other hand, I also took half an hour to clearly explain to you why this is somewhat misguided and tried hard to be polite, while someone below just said "this is fucking ridiculous". It's hard, at least for me, to give constructive criticism, without the other person being offeneded.
- evolve2k 14y agoI find utilising the Feedback Sandwich Technique, with some authentic positive encouragement, usually works well. I apply it mostly when I'm writing something and am getting the feeling that it might not come across so well. http://www.rightattitudes.com/2008/02/20/sandwich-feedback-technique http://www.rightattitudes.com/2008/02/20/sandwich-feedback-t... (from a quick Google)
- regularfry 14y agoI think what the GP might be trying to get at is this: you've reinvented partial function application and first-class functions. An instance of a class can be regarded as a bundle of functions which all have the constructor's parameters partially applied. If your instance only has one method, it's equivalent to a single, partially applied function. In that sense, what you've done is found a way to reorganise a Rails app in a very functional way - and, if you want to do that, given that Ruby doesn't have first-class functions or partial application (well, without proc hack, anyway), this may be the best way to do it. It may work very well, but it's at least as functional as it is OO.
- stiff 14y agoFrom the examples it doesn't even look like a _partial_ function application since it is not clear whether you can control how those services/policies/responders are initialized. Also I think it would be quite awkward for one service to initialize another and call it, so it is not really functional programming either, since there are no direct function calls. Since all the flow of the data is described in the routes file, it isn't OO at all and mostly reassembles dataflow programming as I said: http://en.wikipedia.org/wiki/Dataflow_programming http://en.wikipedia.org/wiki/Dataflow_programming Parts of this approach might be valuable, as I tried to emphasize, but as a whole this doesn't look good for plenty of reasons mentioned in the thread.
- regularfry 14y agoThe CurrentUserResolver example in the README shows that some initialisation control is possible here. > it is not really functional programming either, since there are no direct function calls. There don't have to be. The classes and instances are being referred to by the developer in the same way as any first-class functions defined elsewhere would be - they're actually resolved and called by the framework. > Since all the flow of the data is described in the routes file, it isn't OO at all and mostly reassembles dataflow programming as I said It certainly is OO. There are instances, and they receive and act on messages. Yes, there's a dataflow-like DSL for routing, but that's not to the exclusion of other paradigms.