5 ms·
Is it just me? I don't like this design. What's the point of wrapping an algorithm in strategy, when there is no reuse, nor any need to exchange algorithm? An
by jiriknesl 6y ago
Is it just me? I don't like this design.
What's the point of wrapping an algorithm in strategy, when there is no reuse, nor any need to exchange algorithm?
And more. Why FizzBuzz(15), Buzz(5), Fizz(3); in enum and not in the constructor?
Why "mod" attribute, when the rest of the code doesn't use shortened words? It should be modulo.
Why FizzBuzzOperator when FizzBuzzStrategy's initialization is that easy? Also, again there's no requirement for reusability.
The code here is a classic example of why people make jokes about (usually in J2EE) overengineering solutions where even FizzBuzz will be designed for 1000MD-average-task-size scale.
I have switched to Clojure for good. Our FizzBuzzes are oneliners http://www.learningclojure.com/2014/05/fizz-buzz-interview-question.html http://www.learningclojure.com/2014/05/fizz-buzz-interview-q...
- epicureanideal 6y agoThe Clojure FizzBuzzes may be one-liners, but they are multiple statements, which I'd find easier to read on multiple lines.
- capableweb 6y agoWhich is exactly what you found when you clicked on the link to the blogpost in the previous comment. So what is your point?