Tuesday, March 26, 2024

CST338 - Wk04: Learning Journal Markov

Who did you work with?

I worked with my team 4 teammates (Vance Thrasher, Marcelo Villalobos Diaz, and Anwar Siddiqui) to discuss our Markov solutions.

What was your strategy for solving the Markov assignment?

My approach was the follow the methods provided in the prompt, reading in lines from the file, then splitting the lines into words, and adding those words to the HashMap, with the key being based on the previous word.  After the entire file was read and all the words added to the HashMap.  Then when generating a sentence it was picking a random word that came from the BEGINS_SENTENCE ArrayList in the HashMap, and using that word as the key to pick out a new ArrayList in the HashMap and randomly picking out a word from that ArrayList, until a word that ended with punctuation was found. 

Did you start writing code right away? Did you plan it out on paper? 

I started by first reading through the prompt, and trying to understand the complete purpose of the program and try to see the general flow of the assignment.  I then dove right in adding and filling out methods according to the prompt's requirements.  After that it was working on passing unit tests for individual methods.  And then finally ensuring that then running the program the output matches what's expected.

What was THEIR strategy for solving the Markov assignment?

Their strategy seemed similar to mine, first reading the prompt and reviewing requirements and coming to understand the program.  Others pointed out paying key attention to the UML was helpful to them.  Some mentioned debugging throughput the process of programming the assignment, not just at the end, which is a very helpful technique.  Some stated they sought to implement just enough to get the unit tests running to use the unit tests as the completed the rest of the program.

How would you change your strategy having worked on the assignment?

One aspect I would improve in my coding strategy is to incorporate more comments within the code. Occasionally, I find that when I revisit my code the following day, I struggle to recall the specifics of how certain sections were implemented or how they function. By adding comprehensive comments throughout the code, I aim to provide clear explanations and reminders for myself and others, facilitating easier understanding and maintenance of the codebase.

I would leave more todo comments everywhere where I think there might be an issue with the code so I can review them later and catch bugs more easily. 

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

They stated overall my style was pretty close to the Google Java Style Guide, some differences in spacing (which I have tweaked).  I generally flowed the Google Java Style Guide, matching things like the K&R style non empty blocks

Did you know you can automate applying some of the style guide rules?

I did not! But I will use that going forward with some spacing indent tweaks.


0 comments:

Post a Comment