Code Refactoring

This week the goal was to refactor my code.

My issue this week was transitioning from using windows to MacOS. I decided to complete this lab on my MacBook instead of my desktop windows computer. This was a little bit troublesome as my system was not up to date and I kept receiving errors that we're not related to the program itself. 

A blocker for me in terms of git was that I had started coding on my MacBook and returned to my desktop. For some reason my desktop was no longer recognizing git commands. I had to save a local file of my java file, delete the git repo and create a new one for git to start working again. Unfortunately this didn't save all my commits that I committed while working on this project.

In order to refactor my code I chose to remove redundant code & create a function to shorten the amount of lines being used. Not only did that make my code easier to read, in the future if I want to add flags it will make adding that aspect much easier to manipulate. I've also added appropriate comments to make the code slightly easier to read. Finally although one of the suggestions was to remove global variables, I did the opposite and added a global variable to be able to maintain the "system exit code". 



Comments

Popular posts from this blog

Improving Others Code !

Intro Blog

Release 2.3