CST 338 - Week 2 - Stuff You Should Know

Week 1 was a fun week that jumped right into some good coding exercises in Java. It touched upon a bunch of different themes like basic Java, Unit Tests, Git, Interfaces and more.

I could probably write a lot about how much I fought with IntelliJ (let's be honest it's not the best) but will touch on more substantiative topics.

First let's talk about unit tests. I know JUnit would not be considered a first-class citizen, but the way it is autogenerated by IntelliJ is quite sleek. In that sense writing unit tests and running them is extremely easy. We often read about TDD (test driven development) as a paradigm some organizations use, and building out tests in Java for our exercises really makes me see the value for that approach. Not only does it verify the output for a given input, it also helps us write our functions in a more ... well functional kind of way. I would argue that if you can't write a unit tests, that may actually be a code smell more than anything else. Thinking of our code as simple input // output that maps to a given test makes it a lot easier to think about.

The second thing I'll touch on is git. Git is an amazing tool. I can't imagine trying to write code without source control. I am an avid git user, though I typically just use the command line. Sure you can cut a branch with `git checkout -b {branch_name}` or add a commit with `git commit -am {commit_msg}` or fetch remote branches with `git fetch remote --all` ...but beyond those typical use cases it has SO MUCH VALUE. For example, if you're looking at code and see something wrong you can use `git-blame` to see who wrote it, or what commit it came from. If you're working on something for weeks and it all of a sudden breaks you could use `git bisect` in order to find the "breaking point" in the history of commits. Git is such a powerful tool!

Overall it's excited to jump in and get into the meat and potatoes of the class.

Comments

Popular posts from this blog

CST 300 - Week 2 - More than just a draft

CST 300 - Week 5 - Capstone and More

CST 300 - Week 4 - Writing With Purpose