While working on katas to test the functional calisthenics I realized that some of the rules were not going to be covered by the rules for the katas that I had choosen. Therefore, some additional rules/premises/requirements to the katas were needed. Here I have three of the katas that we have used in the past for OOP and one kata that came out of the HN discussion on the post.
The easiest kata in this post (on its original form), but still difficult enough to pose a bit of a challenge. The main point of the changes revolves around the interactivity of the system. Probably this change makes it the more difficult of the lot to handle using the rules.
Of the katas on this post is the one on which more concepts are present. Which makes it interesting when comparing the solution with OOP. Use of the side effects at the boundaries is explicit with the changes introduced to the rules.
The kata itself is interesting because of the already present dependency on date. The change added is to reflect the rule of side effects at the boundaries. Also, because of the use of an external file/database is easy to think about the use of infinite sequences.
The objective is to place 8 chess queens on a standard chess board without the queens checking each other.
The idea of doing this kata as part of the list of katas to use for functional calisthenics came out of the discussion on Hacker News linked above. One of the solutions to the kata, and the one I used the only time I have completed it, uses recursion with backtracking. But one of our rules says no use of explicit recursion. I am currently working on it, so a pointer for you is the use of reduce in which the accumulator is a collection of boards with the state after placing a queen. I have also to look into Philip's Wadler paper regarding the List of successes method (paywall)
Original Photo by Jason Briscoe on Unsplash
Although he started early (with QuickBasic and Turbo Pascal), took him a while to center into the developer way of living. Nonetheless, he started his professional career back in 2000, and has been a software developer at different levels. His main experience before Codurance was around C# and .Net, but since joining has worked mostly on the JVM stack, using Java and Clojure (he does have a strong interest on functional languages).
In his experience two maxims have been revealed, `Simple is Beautiful` and `Make Everyone's Life Easy`. Because of them, his personal goal is to improve the experience of fellow developers (which always translates to happy customers)
Outside of work, you can find him either playing online or dancing away, or just improving his craft (that is the way of the developer).All author posts
Software es nuestra pasión.
Somos Software Craftspeople. Construimos software bien elaborado para nuestros clientes, ayudamos a los desarrolladores a mejorar en su oficio a través de la formación, la orientación y la tutoría y ayudamos a las empresas a mejorar en la distribución de software.