Functional Tic-Tac-Toe: Speedrun with Richard Wild
We’re getting ready for our Functional Tic-Tac-Toe: Speedrun and Java EE: Ah, Ah, Ah, Ah! Stayin’ Alive! event next week.
The first talk of the evening will be Richard Wild presenting ‘Functional Tic-Tac- Toe: Speedrun’. Most of us are familiar with the game tic-tac-toe. It’s frequently used as a coding exercise, to implement the rules of the game in a computer program. But how quickly can it be done? And how about in a functional style, how fast can it be implemented while avoiding mutating state?
Codurance crafter Richard thinks it can be done in 45 minutes, while driven completely by tests. Along the way he demonstrates the power of the functional programming features introduced in Java 8 for writing concise, straightforward code and also that a problem domain and its solution do not always have to closely resemble each other.
Ahead of the event, we were fortunate enough to catch up with Richard. He told us more about what we can expect from his talk and gave us some great advice for new developers
Who do you think should come along and why?
Java developers if they are interested in functional programming and want to know more about how
to adopt this style of programming in their language. Also, if they do not practice test-driven development but are interested in it and would like to see a demonstration of this technique in action by an experienced practitioner.
What do you think are the three most interesting questions that this talk will answer?
1. What is functional programming really all about?
2. Is FP really compatible with object-oriented programming?
3. How can FP techniques be applied to my Java code and why would I want to do this?
Why do you think this presentation is important for people?
It will demonstrate the power of the functional features that were added in Java 8. If you are programming in Java and not making full use of these features then you are missing out on some great opportunities to enhance the expressivity and conciseness of your code. Writing Java in the functional style allows a reduction in the noise and clutter that Java is infamous for and the purpose of your program will shine through much more brightly.
Similarly, test-driven development is a poorly understood technique; many people have heard of it and
all of those will no doubt have heard it said that automated test suites are “executable documentation”, but this result is only realised when you actually practice TDD with that objective in mind. The presentation will demonstrate the Codurance “house style” TDD technique that all of our craftspeople learn and teach.
Any advice for junior programmers entering the industry?
Try to learn as many programming languages as possible. Specialise in one language and go as deep as you can in it, but try to learn one other language every year if you can. If you do, then gradually you will discover that with only a few exceptions, the similarities between them are much greater than the differences. This will stand you in good stead for keeping abreast of the constant changes that sweep through our industry.
Always strive for simplicity in everything you do. The simplest possible solution is invariably more reliable than a cleverer, more complex solution. Remember that perfection is achieved not when there is nothing left to add, but when there is nothing left to take away.
Commit to lifelong self-improvement. When looking back on code you wrote in the past, you always want to see that it is less good than code you would write today. This means you are not stagnating.
Invest time in learning your tools. Strive to be a virtuoso.
If this has left you wanting more, Richard’s talk is happening on Tuesday 16th October, 18:30 @ Skills Matter, EC2M 7EB. You can find the full details and register here.