Build on the URL

Ilya

2024-11-13T00:00:00.000Z
https://ilyaradchenko.com/notes/cm37ckj6d0001lfpd8hwxwnq2

By Ilya on 11/13/2024, 🌿 Budding - EmberJS, Web Dev, Routing

Intended Audience: Web development, specifically those seeking to up their game

Feels like I keep coming back to the URL quite often as a topic that I write on, and there's a reason for that. Over the last 13 years of my professional software engineering career I've learned to lean on the URL when working with the web, and every time I've implemented a feature while leaning on it, I've been commended because of the unexpected "side effect features" that came out as a result. Here's a few reasons why you should build on the URL.

Shareable

It's a little more work to build on the URL, but you'll be "using the platform" if you do. This allows users of your app to share snapshots of your app with other users. Features like this are used by all, but few apps actually provide good support for sharing. If you can go beyond the basics, and lean on the URL throughout your app it'll be a blessing to someone out there.

While usually we think of sharing as something done with other people, that isn't always the case, a user might want to share a URL with their future selves, via a bookmark. This allows for custom use-cases that you as the developer might not have thought of, but a bookmark solves a problem for a user because you provided access to changing that state externally.

Debuggable

Ding! You glance at your phone, a new email has just arrived. Randy loves your MapMakers app, but today he ran into an issue. His email says that the map marker is not showing up in the right place for the latest listing he created. You ask him for more information, but you don't ask for the URL, because you know it isn't helpful.

Now what if you had a useful URL? You might be able to get into the same or very similar state that your user encountered the bug. It gives you more of a starting point to look from, and if your data loads based on the URL you have your next place you can look to confirm the correct data has loaded. Already you've eliminated a few possibilities, or maybe even found the bug. Now combine this with something like Sentry or DataDog, and you have a URL for all of the errors your users encounter but didn't send you an email.

Scaffolding

When you start thinking about a feature, start with the URLs you'll need, it'll help you flesh out the designs. You can even write tests for those URLs before you have the pages (doing some TDD) built, giving you a progress indicator of sorts. The URL is the smallest primitive you can use to think about a feature you're building, and it'll help you not miss critical pieces.

Go out there, and build your first URL driven feature!

Related Notes

brush and pen
Home