DEV Community

peterlits zo
peterlits zo

Posted on


The username in

When I find my post has url likes:
Enter fullscreen mode Exit fullscreen mode

Of course it is readable. But what happen if the author change his/her username?

I try to rename me as peterlitszoxxx, and I try to access the same post. I find it redirect to my new username! Awesome!

There are a lot of website use user's ID rather than username. I do not think it is a bad idea - Althorgh we loss the readable, but we will never change the user's ID (just because it is not readable).

But when we use a readable thing in the website, what happen if we want to change it? For example, the article in other website may hold the origin url to the post and we cannot change it. If the user change his/her username, the url will be broken.

Redirect is a good idea. We can let a user has a lot of usernames, and limit the speed of change his/her username. But what happen if another user want to use the username nobody using?

Unreadable url looks not well, but it is not a bad idea. and urls in the web are broken easily always. Using unreadable things can make the url avoid being broken rather than using readable things as ID.

Top comments (0)