3 ms·
The class isn’t called URL, it’s called URLPattern. Because it represents a pattern that URLs can be matched against.
by echoangle 9mo ago
The class isn’t called URL, it’s called URLPattern. Because it represents a pattern that URLs can be matched against.
- deleted 9mo ago[deleted]
- socketcluster 9mo agoI was aware of the first part though I foolishly assumed by the name that it was designed specifically to work with the existing URL object. I then experienced a bout of Java PTSD. Upon further analysis of the full API, it's not as bad as I initially thought. My initial reaction was kind of surface-level eye-rolling "Oh no, don't tell me they managed to find a way to make URL parsing even more complicated than it needs to be." But in a way, this is almost an attempt at rolling back the previous complexity introduced by the URL instance and acknowledging the utility of the URL as a string primitive. It is additional complexity but I guess at least it might prevent the need for additional future complexity. I hope that's the idea.