Word Wrap Kata — Java
Yesterday morning after our stand up I gave a zagaku on my process of figuring out TDD in Java without using an IDE, mainly focusing on the things I’ve learned from that experience. This evolved into a great discussion about learning, getting stuck, the apprenticeship in general, and asking questions. I thoroughly enjoyed our conversation.
The rest of the day was spent redoing the Word Wrap Kata over and over again, trying to bring my time down. The goal was to get it done in under 10 minutes, but my fastest was just over 20 minutes.
I recorded my screen and uploaded to YouTube, but a mixture of the giant screen that I’m working on and the compression on YouTube’s end means you can’t see anything. Here’s the video if you want a bit of a laugh. Here’s the repository.
I sent my mentors a message on Slack asking for feedback, and got some really interesting feedback. One thing I would not have thought of is to set a variable
int startOfLine = 0; and another
int offsetByOne = 1 to avoid having the zeroes and ones in my code. We’ve talked about
magic numbers in the past, but in this scenario I wouldn’t have thought that applied. The other feedback was to use more Vim shortcuts, and that it will go a lot quicker when I start using IntelliJ - which I’m going to start using today.
Today will consist of learning IntelliJ and redoing my Hangman Kata, but this time focusing on testing inside the game loop (not the methods), testing IO properly, multiple classes, dependency injection, using method verbs (starting all method names with a verb), keeping all methods shorter than 3 lines, DRYing up all tests, and making the test class as small as possible.
Big day but I’m looking forward to it!
Originally published on Jekyll