News for hackers. Stuff that matters.
Re:Do We Worship Complexity? by sonnyblarney on Tuesday October 16, 2018 @04:17PM (#18232854)
I'm aware.

But either it makes sense to use Command Pattern or not in any given situation and it has nothing to do with complexity really.

I don't see how someone could possibly use a command pattern when simple function would do - that would be beyond pointless. Which makes me believe that there must have been something to the nature of the problem question ...

(Though Lambda's wipe out so many of the simpler use cases of command pattern ...)

Re:Do We Worship Complexity? by Sharlin on Wednesday October 17, 2018 @06:37AM (#18237774)
The whole point was that the GoF Command Pattern is a verbose OO emulation of simply passing around functions. In a language with proper first-class closures the whole pattern mostly dissolves – it’s obvious that if you want to customize behavior, just pass a function. The same holds for a surprising number of GoF patterns.
Re:Do We Worship Complexity? by je42 on Tuesday October 16, 2018 @10:39PM (#18235684)
i think even if you use lambda's - i would still call it a command pattern - if you used lambdas to implement the command class.
Re:Do We Worship Complexity? by TeMPOraL on Wednesday October 17, 2018 @06:58AM (#18237864)
It's an issue of perspective at this point. You can call it "The Command Pattern", as if it was something Important, while others will note that it's just passing a closure around (i.e. a trivial programming pattern at the level of "using if/else" or "throwing an exception").