DEV Community

Cover image for OSD600 - Lab 5 Refactoring and Rebasing??
strawberries73
strawberries73

Posted on

OSD600 - Lab 5 Refactoring and Rebasing??

This week we learned in Seneca OSD600 about refactoring and rebasing.
Lab 5 required us to view our Release 0.1 code thoroughly. Clean it up by removing unnecessary comments, improve proper naming and just making it better without changing the outcome.

I thought it was more complex then it really was. So there I was staring at my code trying to figure out what to change. My friend told me I should change all the "let" and "var" to const. He also said I should make sure I have proper naming. I had learned from some awesome professors at Seneca to use proper naming and use good coding practices to make it more readable. This was a problem!

I didn't know what to do because I had proper naming and no global variables. Luckily I did have some minor things I could do.

    1. Remove unused const colors = require('colors');
    2. Remove some comments // 
    3. Remove unnecessary bloat console.log(process.argv) 
Enter fullscreen mode Exit fullscreen mode

As began to take my steps in the process, I had an internal thought that I was wasting my time with learning these tedious steps. After each change, I commit with a comment. Then I had to do the rebase. I was worried about messing this one up. I honestly found this experience weird. I amended the commit, merged the refactoring and pushed to the master.

To my surprise, I finally understood the necessity and simplicity of not only refactoring but rebasing. I'm glad I learned these steps and will definitely seek the opportunity to do this again.

Top comments (0)