网址是用户界面
What a great title. "URLs are UI." Pithy, clear, crisp. Very true. I've been saying it for years. Someone on Twitter said "this is the professional quote of 2017" because they agreed with it.
多么伟大的头衔。 “ URL是UI。” 脆,清脆。 非常真实我已经说了很多年了。 Twitter上有人说“这是2017年的专业报价”,因为他们对此表示同意。
Except Jakob Nielsen said it in 1999. And Tim Berners-Lee said "Cool URIs don't change" in 1998.
除了雅各布·尼尔森(Jakob Nielsen)在1999年说过。 蒂姆·伯纳斯·李(Tim Berners-Lee)在1998年说过“酷URI不变”。
So many folks spend time on their CSS and their UX/UI but still come up with URLs that are at best, comically long, and at worst, user hostile.
因此,许多人花时间在CSS和UX / UI上,但仍然想出最好,可笑的长URL和最不利于用户的URL。
不是GET的搜索结果-易于共享 (Search Results that aren't GETs - Make it easy to share)
Even non-technical parent or partner things URLs are UI? How do I know? How many times has a relative emailed you something like this:
甚至非技术性的父母或伙伴事物URL都是UI? 我怎么知道? 亲戚给您发过几次这样的电子邮件:
"Check out this house we found!
https://www.somerealestatesite.com/
homes/for_sale/
search_results.asp"
“看看我们发现的这所房子! https://www.somerealestatesite.com/ 房屋/待售/ search_results.asp”
That's not meant to tease non-technical relative! It's not their fault! The URL is the UI for them. It's totally reasonable for them to copy-paste from the box that represents where they are and give it to you so you can go there too!
这并不是要取笑非技术亲戚! 这不是他们的错! URL是它们的UI。 对于他们来说,从代表他们所在位置的盒子中复制粘贴并将其交给您是完全合理的,这样您也可以去那里!
Make it a priority that your website supports shareable URLs.
将您的网站优先支持可共享的URL。
易于缩短的URL-您可以轻松地缩短URL吗? (URLs that are easy to shorten - Can you easily shorten a URL?)
I love Stack Overflow's URLs. Here's an example: https://stackoverflow.com/users/6380/scott-hanselman
我喜欢Stack Overflow的URL。 这是一个示例: https : //stackoverflow.com/users/6380/scott-hanselman
The only thing that matters there is the 6380. Try it https://stackoverflow.com/users/6380 or https://stackoverflow.com/users/6380/fancy-pants also works. SO will even support this! http://stackoverflow.com/u/6380.
唯一重要的是6380。也可以尝试使用https://stackoverflow.com/users/6380或https://stackoverflow.com/users/6380/fancy-pants 。 所以甚至会支持这一点! http://stackoverflow.com/u/6380 。
Genius. Why? Because they decided it matters.
天才。 为什么? 因为他们认为这很重要。
Here's another https://stackoverflow.com/questions/701030/whats-the-significance-of-oct-12-1999 again, the text after the ID doesn't matter. https://stackoverflow.com/questions/701030/
这又是另一个https://stackoverflow.com/questions/701030/whats-the-significance-of-oct-12-1999,ID后面的文字无关紧要。 https://stackoverflow.com/questions/701030/
This is a great model for URLs where you want a to use a unique ID but the text/title in the URL may change. I use this for my podcasts so https://hanselminutes.com/587/brandon-bouier-on-the-defense-digital-service-and-deploying-code-in-a-war-zone is the same as https://hanselminutes.com/587.
对于希望使用唯一ID但URL中的文本/标题可能会更改的URL,这是一个很好的模型。 我将其用于播客,因此https://hanselminutes.com/587/brandon-bouier-on-the-defense-digital-service-and-deploying-code-in-a-war-zone与https相同: //hanselminutes.com/587 。
不必要的长或不直观的URL-人类可读和人类猜测 (Unnecessarily long or unintuitive URLs - Human Readable and Human Guessable)
Sometimes if you want context to be carried in the URL you have to, well, carry it along. There was a little debate on Twitter recently about URLs like this https://fabrikam.visualstudio.com/_projects. What's wrong with it? The _ is not intuitive at all. Why not https://fabrikam.visualstudio.com/projects? Because obscure technical reason. In fact, all the top level menu items for doing stuff in VSTS start with _. Not /menu/ or /action or whatever. My code is https://fabrikam.visualstudio.com/_git/FabrikamVSO and I clone from here https://fabrikam.visualstudio.com/DefaultCollection/_git/FabrikamVSO. That's weird. Where did Default Collection come from? Why can't I just add a ".git" extension to my project's URL and clone that? Well, maybe they want the paths to be nice in the URL.
有时,如果您希望上下文包含在URL中,则必须随身携带。 Twitter上最近有一些关于https://fabrikam.visualstudio.com/_projects这样的URL的争论。 它出什么问题了? _根本不直观。 为什么不https://fabrikam.visualstudio.com/projects ? 由于技术原因不清楚。 实际上,在VSTS中执行操作的所有顶级菜单项都以_开头。 不是/ menu /或/ action或其他。 我的代码是https://fabrikam.visualstudio.com/_git/FabrikamVSO ,我从这里克隆https://fabrikam.visualstudio.com/DefaultCollection/_git/FabrikamVSO 。 那真是怪了。 默认集合来自哪里? 为什么不能仅在项目的URL中添加“ .git”扩展名并克隆它? 好吧,也许他们希望URL中的路径很好。
Nope. https://fabrikam.visualstudio.com/_git/FabrikamVSO?path=%2Fsrc%2Fsetup%2Fcleanup.local.ps1&version=GBmaster&_a=contents is a file. Compare that to https://github.com/shanselman/TinyOS/blob/master/readme.md at GitHub. Again, I am sure there is a good, and perhaps very valid technical reason. But another valid reason is very frank. URLs weren't a UX priority.
不。 https://fabrikam.visualstudio.com/_git/FabrikamVSO?path=%2Fsrc%2Fsetup%2Fcleanup.local.ps1&version=GBmaster&_a=contents是一个文件。 将其与GitHub上的https://github.com/shanselman/TinyOS/blob/master/readme.md进行比较。 同样,我确信这是一个很好的,也许是非常有效的技术原因。 但是另一个正当的理由是非常坦率的。 URL不是UX优先级。
Same with OneDrive https://onedrive.live.com/?id=CD0633A7367371152C%21172&cid=CD06A73371152C vs. DropBox https://www.dropbox.com/home/Games
与OneDrive相同https://onedrive.live.com/?id=CD0633A7367371152C%21172&cid=CD06A73371152C与DropBox https://www.dropbox.com/home/Games
As a programmer, I am sympathetic. As a user, I have zero sympathy. Now I have to remember that there is a _ and it's a thing.
作为程序员,我很同情。 作为用户,我的同情为零。 现在,我必须记住,有一个_是一个东西。
I proposed this. URLs are rarely a tech problem They are an organizational willpower problem. You care a lot about the evocative 2meg jpg hero image on your website. You change fonts, move CSS around ad infinitum, and agonize over single pixels. You should also care about your URLs.
我提出了这个。 URL很少是技术问题,它们是组织的意志力问题。 您非常关心网站上令人回味的2meg jpg英雄形象。 您可以更改字体,无限移动CSS,并在单个像素上苦恼。 您还应该注意自己的网址。
SIDE NOTE: Yes, I am fully aware of my own hypocrisy with this issue. My blog software was written by a bunch of us in 2002 and our URLs are close to OK, but their age is showing. I need to find a balance between "Cool URLs don't change" and "should I change totally uncool URLs." Ideally I'd change my blog's URLs to be all lowercase, use hyphens for spaces instead of CamelCase, and I'd hide the technology. No need (other than 17 year old historical technical ones) to have .aspx or .php at the end of your URL. It's on my list.
旁注:是的,我完全意识到自己对此问题的虚伪。 我的博客软件是由我们中的一群人于2002年编写的,我们的URL差不多可以,但是它们的年龄正在显示。 我需要在“酷URL不变”和“我应该完全改变不酷的URL”之间找到平衡。 理想情况下,我会将博客的网址全部更改为小写字母,使用连字符代替空格,而不使用CamelCase,然后隐藏该技术。 URL末尾不需要.aspx或.php(除了17年历史的技术人员以外)。 在我的清单上。
What is your advice, Dear Reader for good URLs?
亲爱的读者,您有什么建议?
Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test, build and debug ASP.NET, .NET Framework, .NET Core, or Unity applications. Learn more and get access to early builds!
赞助商:查看JetBrains Rider:一个新的跨平台.NET IDE 。 编辑,重构,测试,构建和调试ASP.NET,.NET Framework,.NET Core或Unity应用程序。 了解更多信息并获得早期版本!
关于斯科特 (About Scott)
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
斯科特·汉塞尔曼(Scott Hanselman)是前教授,前金融首席架构师,现在是演讲者,顾问,父亲,糖尿病患者和Microsoft员工。 他是一位失败的单口相声漫画家,一个玉米种植者和一本书的作者。