Today marked day two of my apprenticeship. My goal was the same, continue working on my Tic-Tac-Toe program. I had made some progress the previous day but moving forward felt sluggish. Trying to write code using TDD feels like a barrier has been erected between my brain and the computer. It's probably bad practice, but my normal approach to coding has been to put down some code, play with it, tweak it, and ultimately keep it or reject it. The necessity of writing a test first causes me to try to think of a test for code that hasn't been conceived yet. This leads to blockage.
During my morning meeting with my mentor, I explained some of this and he reminded me that I can still design the software first. I had somehow forgotten about this in my focus on writing a test first. Tests are important but they have to come from somewhere. A design is a logical origin. It's funny though, as much as I enjoy using computers for tasks, it's so much more enjoyable to draw a design on paper.
Perhaps another reason work felt slow was because I am still getting comfortable working in vim. Most of my previous programming work has been in GUI-based text editors and IDEs. I've used vim before but mostly for editing a Linux config file or two. Right now it's taking some getting used to. I keep hitting the wrong keys or have to think for a moment about what I want to do. Today was easier than yesterday, so here's hoping that feeling continues. I still don't have a strong opinion on the benefits of vim, but after seeing how many people in the office use a console editor, I feel it might make working with them easier.
As for progress on my program, the game creates a board and two players. The players can make moves on the board, but only the first player. I haven't added rotating turns yet or win/lose conditions or a whole bunch of things. I'm not sure I like where I've put getting the input. Right now console input is read in the Player class. Thinking about it though, the game doesn't care which player is typing the input or where the input is coming from. It just wants input. I should probably write a more generic get_input function for the game class that takes a prompt and returns the input. Still have to deal with invalid selections and quitting the game, but I'm not going to worry about that at this hour. At least I have an idea of where to start tomorrow.
No comments:
Post a Comment