Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > dashes in URLs

Reply
Thread Tools

dashes in URLs

 
 
j
Guest
Posts: n/a
 
      01-17-2013
On 1/17/2013 9:24 AM, Ben Bacarisse wrote:> j <(E-Mail Removed)> writes:
> <snip>
>> That still leaves open the question of what to replace the "-" with in
>> product name URLs. For the moment, I am just forbidding their
>> usage. Although -dash- is looking tempting.

>
> My gut reaction is to leave it alone. If it occurs in the middle of
> product name, you'd get sensible-looking URLs. For a product called
> "foo-bar":



Lets say we have a product called Foo Bar, and another called Foo-Bar.

If you replace a space with a "-" when you make the URL, then both wind
up as Foo-Bar.

Although that is unlikely, it becomes impossible to tell whether
/product/Foo-Bar

refers to Foo Bar or Foo-Bar

As it turns out there are other characters that are common in product
names that raise havoc in URLs. "/" and "&" being the worst.

There seems to be some standardization toward using a dash as the word
separator, Google encourages it. For those of us who have been writing
html for some time, there is an appreciation for standards, even defacto
standards.

Curiously some of the cargo cult complainers also complained about not
having a Doc Type back in the days (90's or so) when Doc Types had no
impact on page rendering.

Even for someone like myself who has no natural tendencies to follow the
heard, I see the value in using a "-". Google (and the other search
engines) have changed the way they rank pages more than once.

Jeff

>
> foo-bar-details.html
> foo-bar-summary.html
>
> One case for writing it as "dash" might be if the product name uses the
> character literally: for example, a smilie t-shirt with product name
> "t-shirt ". Here, the two uses of "-" are different. The first I'd
> leave alone, but the second might be rendered as a word:
>
> t-shirt-colon-dash-close-bracket-details.html
>
> but
>
> t-shirt-smiley-details.html
>
> is probably better overall. And there might considerations that apply
> specifically in your product area. Do your customers (and others) talk
> about the "dash x" and the "dash y" versions of a product, for example?
> If so, there might be an argument for translating it into a word in the
> URL.
>
> I think the best answer depends on the role that the "-" plays in the
> product name and it's hard to come up with a general answer.
>


 
Reply With Quote
 
 
 
 
Gene Wirchenko
Guest
Posts: n/a
 
      01-17-2013
On Thu, 17 Jan 2013 10:25:28 -0500, j <(E-Mail Removed)> wrote:

[snip]

>Lets say we have a product called Foo Bar, and another called Foo-Bar.
>
>If you replace a space with a "-" when you make the URL, then both wind
>up as Foo-Bar.
>
>Although that is unlikely, it becomes impossible to tell whether
>/product/Foo-Bar
>
>refers to Foo Bar or Foo-Bar


You already have confusion in the two products' names. I would
rename one or both.

[snip]

Sincerely,

Gene Wirchenko
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      01-17-2013
2013-01-17 19:04, Gene Wirchenko wrote:

> On Thu, 17 Jan 2013 10:25:28 -0500, j <(E-Mail Removed)> wrote:
>
> [snip]
>
>> Lets say we have a product called Foo Bar, and another called Foo-Bar.
>>
>> If you replace a space with a "-" when you make the URL, then both wind
>> up as Foo-Bar.
>>
>> Although that is unlikely, it becomes impossible to tell whether
>> /product/Foo-Bar
>>
>> refers to Foo Bar or Foo-Bar

>
> You already have confusion in the two products' names. I would
> rename one or both.


Indeed. And if such clashes occur, you can solve them as they come. It's
not the end of the world if you use URLs with parts like "foo-bar2".

But if you really must have a scheme for cases that have not been
detected and will not be detected - or should be signalled to the Naming
Department instead of some arbitrary URL disambiguation - then you can
turn Foo-Bar to foo--bar. Or Foo--Bar, if you have mixed case, for no
good reason.


--
Yucca, http://www.cs.tut.fi/~jkorpela/
 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      01-17-2013
On Thu, 17 Jan 2013 19:27:51 +0200, "Jukka K. Korpela"
<(E-Mail Removed)> wrote:

>2013-01-17 19:04, Gene Wirchenko wrote:
>
>> On Thu, 17 Jan 2013 10:25:28 -0500, j <(E-Mail Removed)> wrote:
>>
>> [snip]
>>
>>> Lets say we have a product called Foo Bar, and another called Foo-Bar.
>>>
>>> If you replace a space with a "-" when you make the URL, then both wind
>>> up as Foo-Bar.
>>>
>>> Although that is unlikely, it becomes impossible to tell whether
>>> /product/Foo-Bar
>>>
>>> refers to Foo Bar or Foo-Bar

>>
>> You already have confusion in the two products' names. I would
>> rename one or both.

>
>Indeed. And if such clashes occur, you can solve them as they come. It's
>not the end of the world if you use URLs with parts like "foo-bar2".


Marketing would prefer "new-and-improved-foo-bar".

>But if you really must have a scheme for cases that have not been
>detected and will not be detected - or should be signalled to the Naming
>Department instead of some arbitrary URL disambiguation - then you can
>turn Foo-Bar to foo--bar. Or Foo--Bar, if you have mixed case, for no
>good reason.


It is a tempest in a chamberpot.

Sincerely,

Gene Wirchenko
 
Reply With Quote
 
j
Guest
Posts: n/a
 
      01-18-2013
On 1/17/2013 12:04 PM, Gene Wirchenko wrote:> On Thu, 17 Jan 2013
10:25:28 -0500, j <(E-Mail Removed)> wrote:
>
> [snip]
>
>> Lets say we have a product called Foo Bar, and another called Foo-Bar.
>>
>> If you replace a space with a "-" when you make the URL, then both wind
>> up as Foo-Bar.
>>
>> Although that is unlikely, it becomes impossible to tell whether
>> /product/Foo-Bar
>>
>> refers to Foo Bar or Foo-Bar

>
> You already have confusion in the two products' names. I would
> rename one or both.


You snipped the relevant part:

Although that is unlikely, it becomes impossible to tell whether
/product/Foo-Bar refers to Foo Bar or Foo-Bar

And that would be true for any URL with a dash in it. Is it really a
dash, or is it a space? The dash is ambiguous as it could mean either.

Product names are generally plain names and aren't stored encrypted:
Red Dog Collar is stored in the DB as such and not as Red-Dog-Collar.
You put product names in the URL as it adds more information than either
the sku or a numeric identifier would.

When you write software you have to anticipate as many problems as
possible. Anything can happen. Dashes are rare, but not unknown.

Jeff
>
> [snip]
>
> Sincerely,
>
> Gene Wirchenko
>



 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      01-18-2013
On Thu, 17 Jan 2013 20:32:34 -0500, j <(E-Mail Removed)> wrote:

>On 1/17/2013 12:04 PM, Gene Wirchenko wrote:> On Thu, 17 Jan 2013
>10:25:28 -0500, j <(E-Mail Removed)> wrote:
> >
> > [snip]
> >
> >> Lets say we have a product called Foo Bar, and another called Foo-Bar.
> >>
> >> If you replace a space with a "-" when you make the URL, then both wind
> >> up as Foo-Bar.
> >>
> >> Although that is unlikely, it becomes impossible to tell whether
> >> /product/Foo-Bar
> >>
> >> refers to Foo Bar or Foo-Bar


... is right above.

> > You already have confusion in the two products' names. I would
> > rename one or both.

>
>You snipped the relevant part:
>
>Although that is unlikely, it becomes impossible to tell whether
>/product/Foo-Bar refers to Foo Bar or Foo-Bar


What you claim I snipped ...

>And that would be true for any URL with a dash in it. Is it really a
>dash, or is it a space? The dash is ambiguous as it could mean either.


If you design your naming convention that way, then yes, you have
a potential ambiguity. If that is an issue for you, then do not do
that.

> Product names are generally plain names and aren't stored encrypted:
>Red Dog Collar is stored in the DB as such and not as Red-Dog-Collar.
>You put product names in the URL as it adds more information than either
>the sku or a numeric identifier would.
>
>When you write software you have to anticipate as many problems as
>possible. Anything can happen. Dashes are rare, but not unknown.


No kidding. I get the idea that it really does not matter what
anyone posts. You will just do whatever you want.

Sincerely,

Gene Wirchenko
 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      01-21-2013
On Sun, 20 Jan 2013 21:32:00 -0500, Tree hugger <(E-Mail Removed)>
wrote:

[snip]

>Here's a page name that not everyone has:
>
>cf964dec3fba091be1e0f4d6d0668411.html
>
>Yeah, I've got it on my site. Not for the general public, however.


One humour site that I used to go to and which no longer exists
was thegoodnamesweretaken.com (or something close).

Sincerelyk,

Gene Wirchenko
 
Reply With Quote
 
Captain Paralytic
Guest
Posts: n/a
 
      01-22-2013
On Jan 17, 1:06*am, Gene Wirchenko <(E-Mail Removed)> wrote:
> On Wed, 16 Jan 2013 20:52:51 +0000 (UTC), Lewis
>
>
>
>
>
>
>
>
>
> <(E-Mail Removed)> wrote:
> >In message <(E-Mail Removed)>
> > *Gene Wirchenko <(E-Mail Removed)> wrote:
> >> On Wed, 16 Jan 2013 13:22:55 +0000 (UTC), Lewis
> >> <(E-Mail Removed)> wrote:

>
> >> [snip]

>
> >>>Because -'s are word boundaries and _'s are not.

>
> >> * * *Huh?

>
> >> * * *In "co-ordinate", "-" is not a word boundary. *"_" is often used
> >> for emphasis, like this: _like this_. *Can you show me a *word* that
> >> contains "_"?

>
> >That's nice. We're not talking about English, we are talking abut parsing URLS.

>
> * * *Yes, I read the posts. *URLs often have words in them, English
> words.
>
> >"This_is_one_word" to a computer, "this-is-not-one-word" to a computer.

>
> * * *It depends on the language. *For example, hyphens can be part of
> variable names in COBOL as can underlines.


Underlines (or underscores) CANNOT be part of variable names in COBOL.
From:
http://publib.boulder.ibm.com/infoce...obolnames.html
A COBOL name begins with a letter and is composed of one to 30
characters from the following set: letters A-Z, digits 0-9, and the
hyphen or minus sign (-).

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JDBC URLs ...not really URLs? Adam Monsen Java 11 02-08-2009 08:14 PM
Converting Relative URLs into Absolute URLs Nathan Sokalski ASP .Net 1 08-12-2008 07:03 AM
dynamic URLS convert to static URLS for search engines Steve T. ASP .Net Web Services 7 03-04-2004 03:16 PM
Distinguish text URLs from non-text URLs? Kaidi Java 5 01-04-2004 10:15 AM
can i create a xalan java extension function where the function name has dashes (-) in it ? _clb_ Chris Bedford Java 0 08-17-2003 12:57 AM



Advertisments