Adding a new feature to an old project

John Dust
2 min readAug 9, 2021

Why I like to think ahead…

Returning to old code and adding a new feature can be challenging. Some developers end up spending hours trying to figure out where and how you would implement the code for that feature. However, for me, diving into my project My-Coffee-Table wasn’t that challenging. In fact, it was actually quite easy to implement my new feature. It only took me about an hour to build a new on screen iFrame element that could display embedded YouTube videos. But how and why was it so easy? I mean I did end up building this project from the ground up in the span of a week and it even has been a few months since I even have touched this project.

Well, I’ll tell ya. I was thinking ahead!

When designing the database, I knew I wanted to add more ‘elements’ in the future. So I planned for such a thing. I used a polymorphic database model for those elements, which allow me to keep my code DRY and pretty.

When coding the frontend, it was slightly more complicated to implement this functionality. I had to make sure I named everything in a semantic way, so I could easily figure out where code for the new element needed to go.

With me following the Separation of concerns principle during the initial creation, I was able to figure out which files were responsible for ‘element’ objects and I setup the new FancyiFrame element, in around an hour!

Now I just need to improve the UI and UX 🤔

--

--