News for hackers. Stuff that matters.
Re:How to store your app's entire state in the url by anshumankmr on Monday January 09, 2023 @02:24PM (#34314746)
> https://finance.yahoo.com/quote/F/chart?p=F#eyJpbnRlcnZhbCI6...

Dear god... this link was real. I thought it was like a joke or something

Re:How to store your app's entire state in the url by xwdv on Monday January 09, 2023 @02:33PM (#34314857)
There are no jokes on HN.
Re:How to store your app's entire state in the url by 2ICofafireteam on Monday January 09, 2023 @02:44PM (#34314974)
I did once and was told off for adding noise to the discussion by someone who didn't see the irony of their complaint also adding to the noise.
Re:How to store your app's entire state in the url by macintux on Monday January 09, 2023 @02:48PM (#34315033)
If a one-time correction has its desired impact, the small addition to the noise reduces future noise.
Re:How to store your app's entire state in the url by ant6n on Monday January 09, 2023 @03:10PM (#34315296)
This is some sort of meta joke, right?
Re:How to store your app's entire state in the url by munk-a on Monday January 09, 2023 @03:18PM (#34315401)
Why are you assuming they work in FAANG?
Re:How to store your app's entire state in the url by gerdesj on Monday January 09, 2023 @05:44PM (#34317511)
There's no M in FAANG ...
Re:How to store your app's entire state in the url by throw10920 on Monday January 09, 2023 @04:06PM (#34316073)
It's not, and it's pretty clearly true.

The idea that "complaints about people violating the HN norms is somehow comparable to violating the norms" is trivially wrong if one thinks about it for more than a few seconds.

Re:How to store your app's entire state in the url by 2ICofafireteam on Monday January 09, 2023 @10:28PM (#34320164)
Presumably.
Re:How to store your app's entire state in the url by anotheraccount9 on Monday January 09, 2023 @02:49PM (#34315048)
Two chemists walk into a bar. The first says “I’ll take a glass of H2O.” The second says “I’ll take a glass of H2O too.”
Re:How to store your app's entire state in the url by valvar on Monday January 09, 2023 @03:58PM (#34315960)
Oh no...
Re:How to store your app's entire state in the url by xwdv on Monday January 09, 2023 @04:59PM (#34316805)
For many HN, telling someone off for making a joke isn’t noise but rather music to their ears.
Re:How to store your app's entire state in the url by anotheraccount9 on Monday January 09, 2023 @02:46PM (#34315015)
A horse walks into a bar.

Several of the patrons quickly get up and leave, realizing the potential danger in the situation.

Re:How to store your app's entire state in the url by nullsense on Monday January 09, 2023 @06:22PM (#34318000)
This has to be my favorite version I've ever heard.
Re:How to store your app's entire state in the url by TedDoesntTalk on Monday January 09, 2023 @06:50PM (#34318239)
Thank you for posting a joke to HN. Thank you for making me laugh today.
Re:How to store your app's entire state in the url by TeMPOraL on Monday January 09, 2023 @07:36PM (#34318665)
Since I wasn't sure whether it's meant literally or if I'm missing some context, I decided to do a web search with this joke as a query, and was rewarded with a recording of it (apparently) playing out in real life:

https://old.reddit.com/r/gamegrumps/comments/9kgeqg/a_horse_...

Re:How to store your app's entire state in the url by dhosek on Monday January 09, 2023 @10:09PM (#34320028)
A priest, a rabbi and a minister walk into a bar.

The bartender say, “What is this, a joke or something?”

Re:How to store your app's entire state in the url by dspillett on Tuesday January 10, 2023 @03:57AM (#34322170)
A priest, a rabbit, and a minister, walk into a blood donation clinic. The rabbit says "I think I might be a type-o".
Re:How to store your app's entire state in the url by scott_s on Monday January 09, 2023 @02:55PM (#34315119)
There are. We just have a high bar. I wrote this, but others have also pointed to it: https://news.ycombinator.com/item?id=7609289
Re:How to store your app's entire state in the url by BlueNorth on Monday January 09, 2023 @04:29PM (#34316372)
There are different languages. The jokes are symptomatic of the differences. I'm not Indian but English is laughable for many good reasons. Without damage...
Re:How to store your app's entire state in the url by PUSH_AX on Monday January 09, 2023 @02:51PM (#34315074)
Genuinely curious to hear why you are so shocked. Long, ugly, user unfriendly urls are really prevalent. Arguments can be made even query params are pretty ugly.. Are urls expected to be a good UX these days? What's the big deal?
Re:How to store your app's entire state in the url by munk-a on Monday January 09, 2023 @03:21PM (#34315449)
Just because a thing is prevalent doesn't mean it's good. I have a hard time believing all those parameters are completely necessary for the amount of data being displayed. Often times it feels like people just base64encode(page.state) and call it a day.

I think it's advantageous to keep the complexity and specificity of information in URLs to a minimum outside of what's needed to retrieve the data set as it can make backwards compatibility easier - it is valuable (for long lasting tools) to have URLs that users can favorite and share for their common searches.

Re:How to store your app's entire state in the url by PUSH_AX on Monday January 09, 2023 @03:39PM (#34315682)
> Just because a thing is prevalent doesn't mean it's good.

I agree with this sentiment. I'm not sure I've ever seen a url referred to as "good", I was just a bit confused as to why someone would baulk at a URL. In my opinion everything after the host portion of the url is to serve the apps needs, so it knows where to go or what to do, it's not really an interface for the user as obviously there are better ways to present that.

Re:How to store your app's entire state in the url by MereInterest on Monday January 09, 2023 @04:32PM (#34316413)
I’d say everything after the host is part of the UX, and should serve the user needs. For example:

* Should be book-markable.

* If searching with a query, should have a clear query parameter for ease of browser integration.

* If the URL contains slash dividers that can be read as categories (e.g. storefront.com/department/category/product), then deleting everything after a given slash should go to that category’s page.

* The link should be short enough to be sent over a plain-text conversation without becoming a wall of text.

* The link should be short enough that it cannot hide a malicious subdomain (e.g. Google.com.flights.malicio.us/more/elements).

Re:How to store your app's entire state in the url by hinkley on Monday January 09, 2023 @05:51PM (#34317630)
* I should be able to guess if you're sending me a link about composting or a Rick Astley video

Opaque slugs are problematic in a low-trust world. Phishing attempts are easier when the parameters are indecipherable. I'm not clicking on that shit in a text message or an email. I've seen what happens to people when they do.

Re:How to store your app's entire state in the url by pixl97 on Monday January 09, 2023 @07:11PM (#34318440)
Eh, I mean URL shorteners are a thing and all kind of things redirect on the web. The length of the URL doesn't really tell you much.
Re:How to store your app's entire state in the url by TeMPOraL on Monday January 09, 2023 @07:31PM (#34318623)
URL shorteners are a menace. I'm not clicking on the link if you send me a shortened one, especially not when on mobile. These days, shortened links have two primary applications: forcing you to go through a tracking/analytics gate, and serving single-click exploits. Neither of those is serving the user (unless you read it in "To Serve Man" sense).
Re:How to store your app's entire state in the url by whatusername on Monday January 09, 2023 @05:55PM (#34317705)
No - but they have been referred to as "cool" before. Gotta love the early 90's.

https://www.w3.org/Provider/Style/URI

Re:How to store your app's entire state in the url by ben0x539 on Monday January 09, 2023 @09:02PM (#34319381)
The point of a URL is that I can copy+paste it into IRC so my friends can look at the thing I want to share with them.

If the URL has a bunch of goop in it, people are going to make fun of me for it, especially if it's super long and doesn't fit in a single line. Or if there's stuff in there that's specific to me and not the thing I want to show them.

Re:How to store your app's entire state in the url by depressedpanda on Tuesday January 10, 2023 @05:24AM (#34322757)
Where I work, we consider URLs part of the UI. Users should be able to share links with each other without pasting a wall of text. We also try to make all URLs human parsable so that they know what they are sharing.
Re:How to store your app's entire state in the url by bbarnett on Monday January 09, 2023 @07:45PM (#34318758)
I can say that many, many times, I have zoomed in, picked date ranges, added options, then pasted the yahoo finance url to others... and they have all those same configs passed.

It's awesome and incredibly handy.

Yahoo is on the ball here.

Re:How to store your app's entire state in the url by tempestn on Tuesday January 10, 2023 @01:21AM (#34321205)
Agreed. However they could still simplify the urls a ton by including only non-default parameters, and still achieve the same thing.
Re:How to store your app's entire state in the url by itssumitrai on Tuesday January 10, 2023 @03:29AM (#34322016)
Everything in chart is customizable, so no, its not possible to achieve the same thing in the way you are saying
Re:How to store your app's entire state in the url by tempestn on Thursday January 12, 2023 @01:42AM (#34350013)
Yes, but anything that hasn't been customized doesn't need to be included in the URL, so most URLs will be much shorter by only including non-default values.
Re:How to store your app's entire state in the url by dncornholio on Tuesday January 10, 2023 @03:56AM (#34322159)
And what problem does this solve? Hint, it doesn't. Long URL is ugly but who cares. Life is too short. Nice or ugly is relative. It stops nobody from using the tool or sharing links. It's a non-problem really.
Re:How to store your app's entire state in the url by hunter2_ on Monday January 09, 2023 @03:21PM (#34315441)
I don't think people care so much about a messy address bar as a messy chat/email message after pasting a URL. Shorteners and vanity URLs exist, but that's more friction than just copying from the address bar as-is.

This can be overcome with html, markdown, and other rich text formats that let you specify the visible link text (missing from many chat apps*), but that's also friction to compose compared to automatically linking from just a URL.

*Slack's implementation is awesome: type the link text, highlight it, and paste a URL.

Re:How to store your app's entire state in the url by owl57 on Monday January 09, 2023 @03:59PM (#34315973)
It's not even only about messiness. "https://news.ycombinator.com/item?id=34315441" isn't some horrible long base64, but it's not a good UX either: when you paste it in a messenger, or in your notes, by default the reader can't tell what's it about without clicking.

> *Slack's implementation is awesome: type the link text, highlight it, and paste a URL.

Yes! Matches my vision of hypertext perfectly: I usually type a message in normal human language and then paste links all over it for the reader who needs to dig deeper.

Re:How to store your app's entire state in the url by TheBrokenRail on Monday January 09, 2023 @05:44PM (#34317513)
> by default the reader can't tell what's it about without clicking.

Most chat apps like Discord will automatically include an embed generated from a URL's metadata when present in a message.

Re:How to store your app's entire state in the url by owl57 on Monday January 09, 2023 @08:48PM (#34319274)
At least in Telegram, this works for at most one link per message, and quickly fills the screen if you send multiple such messages.

And I believe that there is no standard API to get previews of non-public websites in a work chat, you need to develop site-specific bots or something like that?

Re:How to store your app's entire state in the url by hunter2_ on Monday January 09, 2023 @11:38PM (#34320574)
> previews of non-public websites

It would be interesting if browsers / OSes / apps offered a way to use the browser's cookie jar / basic auth headers / whatever sessioning scheme in whatever apps the user decides should display authenticated previews.

Re:How to store your app's entire state in the url by withinboredom on Tuesday January 10, 2023 @01:45AM (#34321354)
I just include a screenshot. It’s not that hard.
Re:How to store your app's entire state in the url by gdprrrr on Tuesday January 10, 2023 @02:03AM (#34321475)
Plesse no
Re:How to store your app's entire state in the url by efreak on Wednesday January 11, 2023 @12:52AM (#34335459)
Examples of why this is bad:

* http://example.com/settings/transferownership?to=efreak * http://example.com/settings/deleteaccount?confirm=true * http://example.com/sendmoney?to=efreak&amount=10000

Might need a redirect. Do previews follow redirects? Does your poorly-written chat app filter urls by protocol, or does it just look for a token with '://'? A good app will allow me to link to things like steam://connect/IP so I can invite you to a game.

* tel:9005555555 (call a phone number. Fortunately, this requires confirmation these days, but what if you're on desktop or the app that does texting can directly make calls without invoking the dialer?) * steam://exitsteam (steam will exit if it's running)

Re:How to store your app's entire state in the url by WorldMaker on Tuesday January 10, 2023 @03:53PM (#34331305)
There is a standard for this. It's called oEmbed: https://oembed.com/

The chat host still likely needs access to the "non-public website" to discover and call its oEmbed API, so that's something you'd have to figure out, but any website anywhere can offer oEmbed metadata if it wishes.

Re:How to store your app's entire state in the url by OJFord on Monday January 09, 2023 @06:25PM (#34318032)
> I don't think people care so much about a messy address bar as a messy chat/email message after pasting a URL.

But it's painful how few care about that!

I always clean them up before I send them (just manually - typically meaning all query parameters, e.g. with Amazon the text description after the actual ID) rarely even feel the need to check they still work, it's pretty easy, but maybe I shouldn't bother because it's only me that cares; they don't seem to notice that their links occupy half the screen and my don't!

Re:How to store your app's entire state in the url by pacifika on Tuesday January 10, 2023 @08:08AM (#34324262)
Pipe that into bash (ie: the user doesn’t know if they’re loading malicious state)
Re:How to store your app's entire state in the url by anshumankmr on Tuesday January 10, 2023 @11:39AM (#34327488)
I Just like to keep query params simple and readable. I understand the possible use case for this obfuscated url which would make it difficult to scrape the site
Re:How to store your app's entire state in the url by everforward on Wednesday January 11, 2023 @12:36PM (#34341408)
> Are urls expected to be a good UX these days? What's the big deal?

I think they are. If I want to go back to some page I was looking at earlier, it's really nice to be able to find that page in my history. That Yahoo URL is going to be hard to differentiate if you looked at a few stocks.

It's also handy if the URL's are predictable enough that I can hit one directly rather than having to go through search. Good for me because I don't wait on page load, good for them because they don't have to serve my search request.

It's pretty low on my list of UX annoyances, but it is there.

Re:How to store your app's entire state in the url by 1vuio0pswjnm7 on Monday January 09, 2023 @04:22PM (#34316262)
I have seen even worse, on some internal web-based software that most of the outside world will probably never see. I was quite shocked but the crazy thing was that it worked. It was pushing the length limit of browsers for URLs. Unlike this Yahoo! example, the URLs in this non-public software were human readable and editable. As an end user, I always prefer short URLs that are easy to type and edit. The web has improved in terms of URLs IMHO. In the early days, there was not widespread use of descriptive "slugs" and many URLs aimed at "dymanic" content were long, nondescriptive and brittle.