DEV Community

Cover image for Know Thy Code
JC Smiley
JC Smiley

Posted on

Know Thy Code

I want to share a coding bug journey I had yesterday. I was attempting to update a Google Chrome calendar extension for virtual tech meetups with a more personalize user experience. Within a few minutes of coding, I was able to get a working solution on my local device.

Satisfied with my work and determine to push to production, I updated the Netlify server-less function that would deliver the data to the Chrome extension via an API back-end. To my eternal shame, when I viewed the Chrome extension I saw nothing but unformatted strings of numbers instead of a beautiful user experience. I debugged for two hours using every trick I can think of to get the application to work in production like it worked locally. I went to bed in disgust and failure.

Within a minute of sleeping it came to me that I was updating the API and data but never updated the front-end code within the Chrome extension itself that would format the data. I made the horrible mistake of not knowing my code. I didn't consider the application's architecture before I started coding and updated the wrong part of the distributed technical components/systems.

The lesson I want to share is before you start coding:

  1. Consider the architecture of the application and which parts you will be touching. Think about how your changes will affect the front-end, back-end, API, database, etc.
  2. If you are debugging for an extended period, stop and take a break.

Top comments (0)