Oh Boy oh Boy!
I am back with another week's worth of (meaningful) knowledge.
This week we were tasked with refactoring our code for our never ending assignment, link checker (DeadLinkage) for those of you who have not been keeping up with the Kardashians blog.
I had to pick and choose at least 3 things I wanted to refactor about my code... TBH, I wanted to throw the whole thing away and never look at it again. SERIOUSLY! Although it worked flawlessly the whole thing was held together by a piece of reused duct tape that had fallen on the carpet.
Anyways, I started thinking about how to refactor this whole gigantic mess that looked like my current room state, into something that was modular and easier to look at, as well as easier to work with and maintain.
I came up with something similar to the suggestions put out from our professor.
I decided to get rid of global variables such as the CLI ANSI colors and store them into a completely separate class.
Split the main driver of the program into smaller more maintainable components and naturally moved them to other classes/files.
Refactored how the parsing of the arguments was being handled in the main driver program and split into components based on whether the user provides a URL or a local html file.
First thing I had to do once my final commit had been made into my refactoring branch was to rebase and squash the previous commits into one final commit.
This was done by: "git rebase master -i" which opened an interactive rebase editor where I was to pick which commit I wanted to squash the others into.
That went pretty smooth. I was expecting some sort of conflict to occur, but no. 💯
The next step before I merged into master was to make a meaningful commit message because frankly the rebasing commit message was not doing it for me.
This is achieved by: "git commit --amend"
IT IS TIIIIIIIMMEEEE!
Let's merge to master ~sweating profusely~.
uhhhhmmmm... WHAT?!? No merge conflicts second week in a row? Am I doing this right? I mean I will take it and go on about working on designing my game for yet another time consuming course GAM537. #ThanksGeorge
No comments:
Post a Comment