So for this blog post, I decided to look back at some of my own code. Below is a snippet from my CS 161 final assignment. I found a lot of code that could’ve been “cleaner” but the most obvious example is the unnecessary global variables. I also found a lot of redundancies and the readability isn’t great.

I’d like to think I’ve improved since my freshman year, but I know there’s always room for improvement. Looking at the provided readings serves as a good reminder for practices that should always be in the back of my mind while working. If I could go back in time I’d tell myself that I need to keep working on avoiding redundant code by refactoring repeated parts into reusable functions. It’s something I still tend to overlook when I’m rushing to get things done, but I know it would make my code cleaner and easier to work with. I’d also tell myself that I really need to stop using global variables so much. They seem convenient, but they actually make things harder to test and understand later. I need to get better at passing information into functions the right way to make my code more organized and professional.
One reply on “Term #2 Blog post #1”
Thank you so much.