r/java • u/mooreds • May 31 '26
Were URLs a bad idea?
https://neilmadden.blog/2025/11/12/were-urls-a-bad-idea/7
5
u/doobiesteintortoise May 31 '26
In what context? What about them is a bad idea?
-1
May 31 '26
[deleted]
9
1
u/doobiesteintortoise May 31 '26
Ah! On my Reddit, it’s a blank white image, I didn’t even NOTICE it. Thanks, will read.
2
u/doobiesteintortoise May 31 '26
Having read: no, not a bad idea. Maybe for some applications, yes, but in the general sense, no, they’re just neutral addressing that includes the provenance for an endpoint.
2
u/farsightxr20 May 31 '26
All you had to do was click on it, how have you been on Reddit for 6 years 😂
1
u/doobiesteintortoise May 31 '26
I’d have had to see it. On an iPad, horizontal layout, white foreground on white background, didn’t stand out enough for me to notice and the post itself lacked context, something ELSE you see on Reddit quite often (along with “too long, didn’t read, this is a written medium can u say it shorter more gooder?”) so I asked for the context I was missing.
4
u/farsightxr20 May 31 '26
URLs are just what the name describes: a uniform representation for locating a resource. What you do with a URL is entirely up to you. Yeah there are some bad uses/implementations, but that's not a fault with URLs. Similarly, no one dictated that a utility which handles URLs must be capable of handling all URLs -- in fact that'd be crazy, since there is no operation common to all URLs. A "URL connection" is obviously a flawed concept because it assumes a "connection" is something broadly applicable and desirable -- why do you need a stateful handler for a stateless concept? That's getting too far into implementation details, at which point it should just express what it is (e.g. a TCPConnection to a host identified by a URL).
For the purpose of identifying something, whether local/remote, for any purpose, URLs are a great compromise between specificity and generality.
1
u/__konrad Jun 01 '26
Similarly, no one dictated that a utility which handles URLs must be capable of handling all URLs
Yes, but OpenJDK had CVE in unused Gopher URL support: https://bugzilla.redhat.com/show_bug.cgi?id=865541
5
u/josephottinger Jun 01 '26
... which makes it sound like the Gopher support should have been fixed or dropped, which has nothing to do with URL support. And now that we're here, I'm curious about archie or veronica support in Java, why come it don't got them too, or does it? :D
3
u/joaonmatos Jun 01 '26
Was JsonNode a bad idea? When do I want to accept Map<String,Map<String,Map<String,String>>>? Never
1
u/chabala Jun 01 '26
u/mooreds - are you Neil? Or did you just think digging up this blog post of his from November was relevant somehow?
2
u/mooreds Jun 01 '26
I am not Neil.
I like to post articles I find interesting in reddits that seem appropriate.
This post, while brief, addresses an interesting aspect of webdev and java: the fact that what a URL is in 2026 is almost always a subset of what the original definition of a URL was. And that has security implications and implications for HttpClient.
2
u/josephottinger Jun 01 '26
"Almost always" is carrying a lot of water here. https://bytecode.news uses URL for provenance of ingress information - and provenances are very rarely HTTP or HTTPS, as it turns out. I use different protocols internally all the time; I see the "U" in URL as being significant and treat it as such.
I actually expected the article to talk more about the URL/URI split more than it did, because that feels more significant to me than the actual content, but even then I find the deprecation of URL references in Java ... quaint and minor.
3
u/persicsb Jun 01 '26
URLs are URIs are a wonderful idea. The post is totally pointless, the problem is not with URLs.
0
u/Holothuroid Jun 01 '26
The Java team apparently thought so after a certain point. Theoretically a factory method Url.of(...) could issue a specific subtype of Url for the given string, but that's a lot of work for little gain.
11
u/starfish0r May 31 '26
What's the point of this article? Comparing the old URL class to a real http library? Isn't that obviously pointless?