WEEK 10: ENTRY 1
At my internship today, I worked on cleaning my code and handing off my project to my team. Having worked on this project for the past nine weeks, it felt so satisfying and fulfilling that I had the opportunity to finally meet the project deliverables and hand off my project. My code was not the best written code because it was the first time programming in Golang for me; however, now that I looked at how much logic and functionalities my codebase does, it is truly intriguing.
So what does it really mean for me when I say clean my code. Well, as I mentioned earlier, this was my first time programming in Golang. Therefore, I did have a lot of print statements for debugging. I integrated these print statements because they helped me to easily find bugs as well as know the stage of my logic. Another code refactoring I had to do was removed commented out chunks of code. Since these code was no more needed in my codebase, I had to get rid of them so that it’d be more organized and readable. Lastly, I was asked to break down my long functions that have multiple logic in them into multiple functions. This way, I can implement one logic in a single function and return values within that function. A great benefit of having multiple functions is to write test suites so that I can determine if my logic is actually working the way it is supposed to work.
Generally, I learned through this code refactoring that it is much more easier to break my logic into different functions, while writing clean and more readable code. In the future, I plan to integrate this logic to my CS projects and classes.
Comments
Post a Comment