4 ms·
There's one thing in Javadoc that says it all: `@since JDK 1.0` Java is as good as Windows in the sense, that its standard library and set of APIs is very stab
by ivan_gammel 7y ago
There's one thing in Javadoc that says it all:
`@since JDK 1.0`
Java is as good as Windows in the sense, that its standard library and set of APIs is very stable and supports a lot of legacy software. I doubt there's a real need for URL class in the new code by now, given that URI class was introduced in JDK 1.4 almost 18 years ago. There's plenty of dependencies though, so URL will probably stay in the core library forever, but URI represents a superset for URLs, has reasonable implementation of equals/hashCode and is sufficient for majority of the uses.
- toyg 7y agoIndeed, and tbh I'm somewhat surprised this is front-page in 2019. I guess younglings are (re-)learning java and unhearting its umpteen WTFs...
- kelnos 7y agoEh, I dunno, I've been an on-and-off Java person since ~2000 (with consistent JVM development over the last 8 years or so), and I only learned about this URL gotcha within the last couple years. I think https://imgs.xkcd.com/comics/ten_thousand_2x.png https://imgs.xkcd.com/comics/ten_thousand_2x.png applies here, just in a more restricted programmer-y sense..
- vbezhenar 7y ago> I doubt there's a real need for URL class in the new code by now URL class is used to establish actual connection to a resource.
- dionian 7y agoI'm a seasoned java dev (since before 1.4) and i didnt realize i was supposed to use URI, i did know of it, but I'm always confused what to use and wind up using URL. But, just like Vector remains in use in Swing, URL remains in use in the core java library (looking at you, classloader.getresource), so it's easy for me to have made that mistake. then again i dont use it often. mostly come in contact with it when using ClassLoader API.,