|
|
Comments and Discussions
|
|
 |
|

|
Please see my responses below. Thanks for the comments...
>Dirty URLs are difficult to type.
Users don't ever type them anyway. They use the web pages, they don't mess about in the address bar. That's obvious
REPLY: Is it? Have you never received a truncated or wrapped URI in an email and had to reconstruct it? Have you never seen a complex URI referenced in a PowerPoint presentation or hard copy materials? Have you never had someone repeat one over the phone to you?
>Dirty URLs are a security risk.
No they aren't. Bad programmers are the risk. You do not offer an alternative that is better than a query string!
REPLY: First, you neglect to mention file extensions, which are a major source of "noise" in traditional URLs, and which almost always betray the backend technology. This a principal reason we suggest removing them. As to query string alternatives, we make two suggestions in the article: 1) pregenerate static pages where appropriate (which has additional performance and searchability benefits) and 2) rewrite them to a more innocuous, harder-to-guess-at format (an old mod_rewrite trick, as detailed in some of links at the bottom of the article).
>and the parameters used (via the query string)
But they do promote abstraction. [confused] The query string has a standard format (I have used PHP, C# and Java). So you can use any language on the server. I really cannot understand where you are coming from on this.
REPLY: First, while a query string is not bound to the technology used to parse it (though, as we point out, the file extension normally is), it does nothing to abstract the URL from a key implementation detail, namely, whether the page is dynamic or static. A clean URI, by contrast, has the same form regardless of how, or when, or by what kind of agent, a given resource was composed.
Second, doing without the query string format is one way to encourage developers to stop thinking of the URL as part of a backend system, and to start thinking of it as what it is -- a public interface. Maybe this in turn will help discourage such practices as exposing database field names in the URL -- the SQL injector's delight.
Finally, to take the idea still further, imagine getting rid of parameter names altogether. Think of how modern programming languages work. Imagine having to do this to call a function:
foo(parm0=value0, parm1=value1, parm2=value2)
Silly looking, isn't it? Why should someone calling this function need to know (and accurately repeat) the internal parameter names? Why should its implementation be bound to those names forever? Why not abstract such details from the interface?
Well, exposing parameter names in a function signature makes no more sense than exposing them in a URL's query string. This illustrates a general principle of abstraction: anything internal to the application that _can_ be taken out of its public interface, should be. Obviously, the traditional query string isn't there yet.
|
|
|
|

|
Ok, thanks for your reply.
|
|
|
|

|
Chris Neppes (for the authors) wrote:
Finally, to take the idea still further, imagine getting rid of parameter names altogether. Think of how modern programming languages work. Imagine having to do this to call a function:
foo(parm0=value0, parm1=value1, parm2=value2)
Silly looking, isn't it? Why should someone calling this function need to know (and accurately repeat) the internal parameter names? Why should its implementation be bound to those names forever? Why not abstract such details from the interface?
Well, exposing parameter names in a function signature makes no more sense than exposing them in a URL's query string. This illustrates a general principle of abstraction: anything internal to the application that _can_ be taken out of its public interface, should be. Obviously, the traditional query string isn't there yet.
I can fully understand your point, as in the point about amazon and the /sciencefiction/asminov querystring.
However, Visual Basic uses this syntax, and if you ever use ADO, or ADO.NET with parameters, you will also know that this kind of functionality is used. The reason it is used is because it allows you to ommit optional parameters. Similarly, if you could goto amazon.co.uk/author=asminov&category=sciencefiction, or amazon.co.uk/title=irobot&author=asminov, then surely this would be more usefull that trying to second guess whether you needed to enter the category then the author.
I can see how this kind of functionality can be usefull (especially if you have a good search engine for your site, so that going to http://www.foo.com/thing returns a search result for "thing" rather than a 404), but simply putting in place another method of passing parameters to the site isn't going to help, as users are rarely going to think of the same random URL as the programmer.
|
|
|
|

|
(For the authors):
I think you are confusing two different cases here, each of which demonstrates a different advantage of clean URIs:
Case 1: You have /www.foo.com/thing and the /thing is an interface to a resource that is reasonably represented by that term. This is like saying www.microsoft.com/word and getting the main Word homepage, for example. Here, the advantage of a clean URI is primarily for the end user seeking to find a resource, without necessarily knowing where it is in the site -- as you point out, it is a kind of search mechanism.
Case 2: You have actual URL parameters, some of which happen to be optional. In this case, if one wants to keep the URL as abstract as possible, optional arguments could easily be accomodated the way they are accomodated in most programming languages, namely as something that can be added to a call when necessary. Thus, just as both of these function calls will work:
foo(arg0, arg1, optarg0)
foo(arg0, arg1)
...so would both of these URLs:
www.foo.com/arg0/arg1/optarg0/
www.foo.com/arg0/arg1/
Here, the abstraction is not for the sake of end users, but rather for programmers -- those who build and maintain the application, and those who make use of it -- and the main benefit is not searchability or guessability, but interface persistence. Even VB, as verbose as it is compared to a terse language like C, still does not require that arguments be named when they are passed.
|
|
|
|

|
I like the query string to URLs. It makes it possible to specify parameters. For example, I can take google and be simple:
google.com/search?q=search
^-Google ^-Search ^-Query
Nice and clean. No need to type http://www.google.com/search?hl=nl&ie=ISO-8859-1&q=search&btnG=Zoeken&lr=
- Daniël Pelsmaeker
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Changes are afoot in both development practices and Web server technology that should help advance URLs to the next generation.
| Type | Article |
| Licence | |
| First Posted | 20 May 2003 |
| Views | 62,750 |
| Bookmarked | 25 times |
|
|