Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate URL apis in favor of GlideUrl #176

Closed
sjudd opened this issue Oct 6, 2014 · 2 comments
Closed

Deprecate URL apis in favor of GlideUrl #176

sjudd opened this issue Oct 6, 2014 · 2 comments

Comments

@sjudd
Copy link
Collaborator

sjudd commented Oct 6, 2014

The URL class has a number of problems, we shouldn't be encouraging people to use it. Using strings or just GlideUrl directly is substantially more performant.

@TWiStErRob
Copy link
Collaborator

My two cents:
If someone already has a URL (e.g. received from a library) they shouldn't have to write more code to convert it to GlideUrl or String which will then convert it back to some object anyway.

@Deprecated with an explanation should be sufficient, but don't plan to remove it.

NB: I'm also lost in this world of String/URL/URI/Uri/File/Path/FileDescriptor/..., so many things to describe something very similar. I was just too lazy to look it up, probably others did the same.

@sjudd sjudd closed this as completed in 7d7d03d Oct 9, 2014
@sjudd
Copy link
Collaborator Author

sjudd commented Oct 10, 2014

Ugh I closed the wrong issue from that commit.

Yeah I think @deprecated is sufficient. The goal here is to emphasize that it's a performance problem to obtain and use URLs directly because constructing a URL, URL#equals and URL#hashcode all perform network operations. The GlideUrl class largely mitigates this, but can't do anything about the constructor jank.

Ugh yes URL vs URI vs Uri in particular is frustrating, particularly because URL looks like exactly what you want if you're trying to do http/https, but in fact is usually not what you want unless you're actually trying to perform a network request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants