3 ms·
Well, that just executes code. That doesn't alter your application flow, unless you do that during runtime at (for lack of a better word) cutpoints. And if yo
by ircmaxell 15y ago
Well, that just executes code. That doesn't alter your application flow, unless you do that during runtime at (for lack of a better word) cutpoints. And if you do it there, it's basically Chain of Responsibility, without the "chain can be cancelled" part.
Just because the pattern has a name, doesn't mean it can't be simple. In fact, a lot of the patterns are implemented all over the place under different names and with slight tweaks.
An important point is to understand the difference between the patterns, and know how to identify them. You can call a cow a lion, but it'll still moo just the same...
- Loic 15y agoWhat I mean is that most of the time people tend to fire heavy duty classes or libraries to implement these patterns when you can implement just what you need with very little overhead using the built-in language constructs. I use both Python and PHP extensively and I find interesting that Python developers try to go to the minimum that work while PHP developers try to go the nice conceptually "right" way. I wonder if this is because the PHP developers kind of need to prove that they can do rigorous OO programming with their language or something like that where the Python developers do not care and just do it the simple intuitive way.
- jakejake 15y agoI like using classes with PHP not because I have anything to prove, but because I like having auto-complete for my properties and methods in Eclipse and I like getting compiler errors if I mistype a method name. I'm getting more used to using generic structures and anonymous functions as I write more Javascript but it bugs me sometimes having to look at the source code or API docs to remember what parameters are available for a method call. I guess it's being lazy in a different way - I like to do more work upfront so I can be lazier later!