DEV Community

Cover image for Know Thy Code
JC Smiley
JC Smiley

Posted on

4

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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay