Fizz Buzz Through Monoids
Some decade ago I read a good implementation of fizzbuzz. What set it apart was its excellent modularity. The original article is no longer on the web, but this is my reconstruction:
In[1]:
The great thing about this implementation is that when we get the natural change in requirements – that we are supposed to print “zork” for multiples of seven – we can accommodate that change by simply adding the line that does so:
评论
?
参与讨论