Top
Best
New

Posted by thm 11/2/2025

URLs are state containers(alfy.blog)
512 points | 213 commentspage 6
tingletech 11/3/2025|
Reminds me of xlink:href with an #xpointer(xpath) — with it you could xinclude an inner XML node out of a remote file
jcparkyn 11/2/2025||
One of my previous side projects used this idea in the extreme: It's a two-player online word game (scrabble with some twists) but all the state is stored in the URL so it doesn't need a backend.

https://scrobburl.com/ https://github.com/Jcparkyn/scrobburl

jwpapi 11/2/2025||
As an application developer I think this is very good advice and I wish I wouldve be more strict about it earlier.
alansaber 11/2/2025||
This is something you learn to appreciate when you do web scraping. I do overlook it for frontend webdev though
dep_b 11/3/2025||
Sounds like ASP.Net Web Forms! Except it would fall apart anyway when you would reload!
simonhamp 11/2/2025||
React kid discovers the web
game_the0ry 11/2/2025|
Holding the snark aside for second, I think there is some harsh truth here.

Url query params are not popular in the front end developer world for some reason, probably bc the fundamentals of web dev are often skipped in favor of learning leetcode and all the react hooks. Same could be sade for SQL and CSS.

I also don't think its a good look that the author is a CTO and is just discovering how useful url query params are. that being said, its a pretty good and well-written blog post.

simonhamp 11/2/2025||
No snark. Genuinely happy. This is progress
yubblegum 11/2/2025||
Sure and file names are state & attribute containers too. A URL is a uniform resource locator. You can hack it, of course, but this is no less kludgy than overloading filename. It is never ceases to amaze me seeing the recylcing of good and bad idea in this field.
croes 11/2/2025|
Urls have extra parts like the parameters to store that data. It’s not a hack
ratelimitsteve 11/3/2025||
is this not a basic rest principle? URLs and req/res bodies are the only way to transfer anything so they must be the way to transfer state
moralestapia 11/3/2025||
Yes, but keep it less than 1024 chars in length.
naasking 11/3/2025|
Wasn't IE6 the worst offender here? I think URL lengths can be longer now, although I doubt 4096 chars is portable.
righthand 11/3/2025|
It’s kind of nuts this even has to be explained. I had a coworker I’ve been trying to teach good application design and React state is the first “crap bucket” he always reaches for. I had to explain to him, “when we put values in the Url we don’t need to use state, because everything is already stored right?” “Uhhh sure fine go ahead and change it.”

But what bugs me about it is that this isn’t even that novel or intelligent of a realization. If you’ve used a web browser you’ve seen the url change. Connecting that with putting values in the url shouldn’t be such a huge leap. This was for a simple search page.

How do I stop this sort of brain dead unrealized thinking?

More comments...