DEV Community

Cover image for Coming Face-to-Face With My Worst Code
Justin Ho
Justin Ho

Posted on • Updated on • Originally published at jcsh.dev

Coming Face-to-Face With My Worst Code

Cover Photo by Ryan Riggins on Unsplash

Preface - A Soliloquy

I swear I'm not crazy

Hello my future-self, it's that time of the year again; the time when I revisit my old GitHub repositories and come across that repository.

Yes, the one I quickly put together without caring for code quality or documentation. It might have been for a hackathon, a course project, for anything really. The point is that its sitting there in the wild, for any potential recruiters to see.

But I don't have the heart to delete it. And to be fair, despite all its problems, I did put in effort to create it and it did have a purpose, however small or contrived.

So instead of continuing to let it rot because it was a relic of my past, this time I'll do the unthinkable: refactoring an old code base.

Introduction

Whether you resonated with my overly dramatic preface or not, there comes a time in a developer's life where they have to refactor code. In my case, I have already experienced refactoring old PHP code at my last workplace, but I realized that I could be doing this to any of my personal projects instead of starting new ones.

The Project

The personal project I want to improve upon is HypeTracker, a data aggregator / data visualization app for sneakers. It's honestly a great project from a business idea standpoint; the project aimed to consolidate qualitative and quantitative data to answer a simple question: "Should I buy this sneaker right now?". I wrote in depth about the data modelling and database design aspects in my post here.

100 Days Of Code

In addition, I always see this challenge trending so I want to use this chance to encourage myself to code 1 hour a day dedicated to this project as well.

High-Level Goals

A goal without measurable steps isn't really achievable so let's start off with a short list here.

  1. Remove JQuery Dependencies
  2. Migrate to Laravel Framework
  3. Use Test Driven Development to (re)implement business logic
  4. Implement a CI/CD pipeline to deploy this to the cloud

These are the high level goals I want to accomplish for HypeTracker. To be completely honest, I might not achieve all of them, and that's okay, because I know I will have learned something from doing this.

Afterword

That's it! Next post I'll do a recap of what HypeTracker currently is and some more details on where I'm taking it.

As for you reading this, I challenge you to look at your old coding projects and find one where it gave you a sense of joy and pride when you worked on it, only to have learned better now, and think about how you would make it better now.

Then take that one step further, actually start making it better, create an issue, make a pull request, anything really.

Leave a comment if you have a project like that and how you've grown as a developer since then!

This post is not meant to make you feel bad about your old projects. In fact, take pride that all these unfinished projects took you here. This is just a reminder that you had amazing ideas which may not have been fully realized by the you of yesterday

Top comments (2)

Collapse
 
cgcnu profile image
sreenivas

Reminded me of Eagleson's law, “Any code of your own that you haven't looked at for six or more months might as well have been written by someone else. ” Now it doesn't have to be that way. But, sadly it is most of the times, especially when we are starting out.

Collapse
 
jcsh profile image
Justin Ho

Haha, I relate to that very much. Atleast now, I'll always think about the next person who has to maintain my code after I'm done.