The past week at Launch School(currently in RB 101) I have been working on larger programs than what I have recently been used to; creating working games. One game was Tic Tac Toe, and adding features like allowing who goes first in the game to be changed, and determining the winner after one player(or the computer gets to five). The other program I wrote was a game called TwentyOne, which is similar to blackjack where a dealer continuously deals cards to the player.
I struggled at first pulling a game together, a larger amount of code with five or more methods, and being asked to add unexpected features after the code had already been designed. I definitely learned this week, as well as from my first code review with Launch School, that breaking your code up into manageable methods is essential. I realized that the more I broke up large or repetitive items into methods that the easier my code became to work with. Adding the bonus features to the tic tac toe game, before I started breaking up my code into manageable methods, was way way more difficult than adding bonus features to the TwentyOne game which I had already cleaned up. Debugging also became much easier, and making changes was much easier. I am very glad that I submitted my first code review!
This February I also began using Pry, and pry-byebug, a Ruby debugging tool. Previously I was pasting all my code into irb, and that was very slow. Being able to skip through code using “next” , see the value of current variables, and trying out methods with different values is so helpful with pry/pry-byebug. I also see that with pry, changing a method and seeing the different output is also possible, while still being in the program/debugger tool.