Tuesday, July 23, 2024

CST 338 - Week 5

This week, we worked on a Markov Text Generator, which creates new sentences from a list of random words taken from a text file. After completing the homework assignment, we were tasked with reviewing each of our teammates' code for the Markov assignment.


Who did you work with?
My teammates Alan and Abdul.


What was your strategy for solving the Markov assignment?
I began the assignment by creating a skeleton for the class and then read the prompt for each method to think about how I wanted to work through it. I then implemented each method one at a time, not moving forward until the tests for each method passed. I did run into an issue trying to pass the addBadLineTest(), but that was due to me only accounting for the extra whitespace at the beginning and end of each line.


What was their strategy for solving the Markov assignment?

Abdul: "I started by making sure I understood what the assignment was asking for and what the goal was. Instead of writing the code, I took some time to think through the structure and logic. This helped me get a clear understanding of how to combine the statements and methods for completing the assignment." 

Alan: "I started by creating a skeleton of the Markov class, including all of the fields and methods in the assignment description. I then implemented all of the methods for creating the dictionary of words, and then later implemented all of the methods for generating sentences. Lastly, I worked through the two failing tests one at a time to fix the handful of bugs/missing features that they found."


How would you change your strategy having worked on the assignment?
I don't think I would change anything about my strategy process for writing the code. However, I did notice two of my teammates using a BufferedReader instead of a Scanner like I did. I am curious if that might be more efficient for completing this assignment, especially if we had a larger file to read from.


According to your classmate(s): how well does your code follow the Google Java Style Guide

Abdul: "Method names are clear and follow camelCase conventions. The code is clean, well-indented, and uses braces properly, aligning with style guide standards. Its logical flow is straightforward, making the code easy to read and maintain."

Alan: "The only thing that I could find is that the style guide asks for a blank line between the paragraph and the tags for javadoc ( §7.1.2)."

No comments:

Post a Comment

CST462S - Service Learning Experience

With the first half of my Summer semester now coming to a close, I am submitting my final assignments and preparing for the upcoming class i...