Wk05: Learning Journal Markov

For the Markov learning journal I worked with two classmates, Sylvia and Jael, and we compared our solutions over Discord. For my own strategy, I first read the prompt and the Javadoc very slowly, then I looked at my previous notes from class and the Google Java Style Guide to remind myself how things should be written. Before I started coding, I actually wrote things down on paper like the fields I would need, what each method should do, and how the data should flow through the HashMap. After that planning step, I opened the tests to see what each method was supposed to return, then I implemented one method at a time like addFromFile, getWords, and getSentence and ran the unit tests after each change so I could fix mistakes right away instead of at the very end.

Sylvia's strategy was more structured, she followed the intro video, set up the basic class and method stubs, then carefully copied the logic from the prompt into Javadoc and used that as a checklist while implementing each method, only moving on when the related unit test passed and the sample output matched. Jael’s strategy was also very organized, she read the prompt carefully, sketched the structure with pen and paper, studied the UML, then coded the fields and empty methods before adding the logic and Javadoc, and finally kept revising and debugging until every test passed. After working with them, I would like to lean even more into planning before I code, spending extra time with handwritten notes, the UML, and the style guide and to use the tests in a more intentional “one method at a time” way instead of bouncing around.

According to my classmates, my Markov code mostly follows the Google Java Style Guide, my variable and method names are clear, my comments and Javadoc are in the right places, and the formatting is generally good. They did point out some small style fixes I could make, like adding a space between the closing parenthesis and the opening brace in method headers, and wrapping long Javadoc lines so they stay under about 100 characters. I also learned from them that you can automate a lot of these style rules using tools like Google Java Format or the built-in formatter in the IDE, so in the future I want to rely more on those tools to keep my code consistent with the style guide.

Comments

Popular Posts