3 ms·
My Brain Can’t Handle OOP Anymore
- spacemanaki 14y agopreviously: http://news.ycombinator.com/item?id=3938566 http://news.ycombinator.com/item?id=3938566
- Tinned_Tuna 14y agoI would argue that in this case, the author is technically wrong with his argument. You do not need to know the entire history of the foo object, only the intrinsic state and the arguments to the current method call to determine it's behaviour. This means that a method on an object can be modeled as add :: (foo, integer) -> integer. That is not to say that this is necessarily easy, and yes, singletons do complicate this by making it difficult to know exactly what the intrinsic state of an object is as they essentially hold a reference to something which may be modified by something other than the foo object. I fully agree that functional programming seems like a good idea right now, but I would also say that this particular problem is mainly due to the programmer failing to adequately control and rein in extra, unnecessary state.
- Delmania 14y agoMy personal opinion on this OOP vs. FP debate is that this is a result of that fact that OOP has been taught as being the only way to write software, not as one of many. OOP has it's place. When you have a complex system that needs to keep track of state since the entities within thayt system behave differently dependng on the state, that's a good time to use it. Design patterns are like chess moves, they give us a good place to start working from. However, if the problem doesn't fit the pattern, most people try to make it fit rather than redesining it based on what they learned. Functional programming is better for time when you don't need state. You need an answer based on the current state, but that's it. I personally think both paradigms have a place in modern development..