Learning Journal - Week 13
Markov Project Review
Recently I completed an assignment that emulates a Markov chain and creates a predictive text algorithm based on text files it reads in. This is actually similar to a project I've attempted in the past in C++, so giving it a shot in Java was a fun exercise.
For this review, I partnered up with one of my teammates Jessica Sandoval.
My strategy for solving the problem was similar to my solution solving my first Project. I began by reading the prompt thoroughly, and laying out the class variables as outlined by the provided UML diagram. I also took note of the suggestion to split off my code into two branches: one for reading text input and one for generating sentences. I set the first branch, and after reading through the prompt more and getting a full understanding of the requirements, I began to layout my starting method for file reading. I laid out pseudocode in the form of code comments to show my line of thinking to ground myself on what the method is supposed to do and also to add readability to anyone reviewing my code. Finally, once my pseudocode was laid out for that method then I began writing lines of code under each line of pseudocode, and I would even write down calls to methods not yet implemented. Once I finished my initial method, I would then move on to the un-implemented method I called and write that method. I followed this process until every method that was necessary for file reading was generated. I passed my initial tests and continued to the next branch. The process was much of the same, although I ran into a few formatting issues, but after I cleared up my last tests I was all done.
Jessica's strategy also involved reviewing the UML diagram and using it to follow the order of what to setup. She began with the methods that call no other methods and worked her way up, which was a little different to what I did but also something I likely would do. She also spent some extra time reviewing concepts that were used in the assignment, like unit testing and Hashmaps, which helped give her ideas on how to solve the problems.
Having worked on the assignment already, I would actually be interested in attempting the solution without following a prompt. I want to see how my thought process would differ from the provided instructions. I felt like I didn't have to do too much problem solving on my own because the prompt and documentation was so thorough, so I'd enjoy to re-approach the same problem and attempt the same solution with no provided UML diagram or detailed methods.
According to Jessica, my code adhered to the Google Java Style Guide standards, and she also let me know that my use of comments throughout the methods did help to make it readable and easy-to-follow.
Overall, completing this assignment was very rewarding and I enjoyed reading through the sentences my code generated. I intend to try to replicate it again on my own time without following documentation to see if I can write up my own logic.
Comments
Post a Comment