Week 5 Learning Journal
My own strategy for solving the Markov assignment started with reading the entire prompt carefully before writing any code. I wanted to understand every requirement upfront, so I did not get stuck later or misinterpret what the functions needed to do. After that, I focused on writing the simpler input and output functions first, anything that took parameters and produced a straightforward result. I saved the functions with dependencies for last. Throughout the process, I ensured each function did exactly what it was supposed to before moving on. I did not write anything out on paper, but I did plan in the code editor by using pseudocode comments to think through the logic before actually coding it.
My classmates used similar but slightly different strategies. Manuel approached the assignment in two major phases. They first built the dictionary by writing the addFromFile, addLine, and addWord methods, making sure the HashMap correctly mapped each word to its list of followers. Once that part passed the tests, they moved on to generating sentences using randomWord, endsWithPunctuation, and getSentence. They also ran unit tests frequently to check progress. Before coding, they spent some time thinking about how prevWord should behave and when punctuation resets to "__$", but they did not create a detailed written plan.
Quratulain also worked in stages. Their approach was to complete the dictionary portion first because it was simpler and formed the foundation for the rest of the assignment. Testing as they went helped them confirm that the structure stored all the needed information correctly. Once that part was finished, they moved on to the more complex sentence generation portion, building on the foundation they had already validated. They did not formally outline anything, but they still thought through the order of tasks before beginning.
Having completed the assignment, I would change my strategy by putting more emphasis on planning the code structure early on rather than relying so heavily on pseudocode inside the editor. Seeing how my classmates thought through the logic beforehand made me realize that clearer planning might have saved me time later, especially when dealing with dependent functions. I also would have spent more time checking stylistic details throughout the process instead of leaving that to the end.
According to my classmates, my code followed the Google Java Style Guide fairly well overall, but there were still some issues. They mentioned that I could use more Javadoc comments, and that the spacing and indentation were sometimes inconsistent because I am used to writing with 4 spaces instead of the required 2. I also forgot to address some of the indentation issues that carried over from the previous assignment. Finally, I learned that many of the style guide rules can be automated, which I did not know before. Now that I am aware of this, I plan to use those tools in future assignments to improve consistency and save time.

Comments
Post a Comment