473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Naming used in HTML

seems interesting?

Q. Which naming convention for HTML stuffs you perferred?
e.g.

1. user-list.html VS userlist.html VS user_list.html

2.

<div id="main_content"... or <div id="mainContent".. or <div id="main-
content"..

have fun.

Mar 24 '07 #1
9 1871
howa wrote:
Q. Which naming convention for HTML stuffs you perferred?
1. user-list.html VS userlist.html VS user_list.html
The telephone test applies. Ring up your girlfriend and tell her about your
brand new site:

user-list.html: userdashlist.html, userheiphenlist.html, userminus.html,
user_list.html.

user_list.html: userunderline.html, userunderscorelist.html, user-list.html.

userlist.html: userlist.html.
2.

<div id="main_content"... or <div id="mainContent".. or <div id="main-
content"..
Who cares, it's internal to your web page, not (normally) visible to the
viewer. Use whatever you want.

--
Richard.
Mar 24 '07 #2
Richard Formby wrote:
The telephone test applies. Ring up your girlfriend and tell her about your
brand new site:
I don't think it matters. "Go to example.com and click on the user list
link."
Who cares, it's internal to your web page, not (normally) visible to the
viewer. Use whatever you want.
Agreed. But I like 'main_content'. It is easier to read.
Mar 24 '07 #3
Scripsit Richard Formby:
>1. user-list.html VS userlist.html VS user_list.html

The telephone test applies. Ring up your girlfriend and tell her
about your brand new site:
My wife might get upset... The telephone test doesn't apply to _everything.

Besides, this is more about page (file) names than site names. My brand new
_site_ might be http://user-list.example.com but then I would probably want
to register http://userlist.example.com as an alias as well (and
http://user_list.example.com would probably be rejected by Dummy Inc., the
registrar for example.com).
user-list.html: userdashlist.html, userheiphenlist.html,
userminus.html, user_list.html.

user_list.html: userunderline.html, userunderscorelist.html,
user-list.html.
userlist.html: userlist.html.
So you recommend the last one, I presume. You have a point, but how often do
you read URLs aloud? I'd say Google matters more. Search engines generally
give much weight to the URL, and people will more probably use "user list"
(which matches "user-list" and "user_list" since Google treats special
characters as separators only) rather than "userlist" in their searches.
Google is a bit mystic in this area (it seems to treat "userlist",
"user-list" and "user list" as equivalent in some cases but not all), but I
would put my bet on the "user-list" horse.

Moreover, for long words, "user-list" style is more _readable_ than
"userlist", and people like to see a URL as a meaningful and readable string
even though they rarely pronounce them.

Between "user-list" and "user_list", it's difficult to decide. Using
"user-list" makes the URL breakable when it is rendered visibly (since
browsers may introduce a line break after "-"), but it looks more natural
than "user_list", which also suffers from the drawback that if underlined,
the underline is not always easy to distinguish from a space.
><div id="main_content"... or <div id="mainContent".. or <div
id="main- content"..

Who cares, it's internal to your web page, not (normally) visible to
the viewer. Use whatever you want.
As long as you are consistent. But actually, #main_content or some of the
other options _is_ visible to a user if someone links to that location on
your page. The id attribute values are potential destinations for links.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 24 '07 #4
On 24 Mar, 07:02, "howa" <howac...@gmail.comwrote:
seems interesting?

Q. Which naming convention for HTML stuffs you perferred?
BE CONSISTENT!

BE CONSISTENT IN ANYWHERE THE USERS CAN SEE!!

HTML doesn't have much naming itself. HTTP and the HTML DOM are the
common requirements to start adding names to things.

HTTP is case-sensitive (unless made to be not so) It's also used by
people who don't understand this. So don't rely on it, don't make it
confusing and assume that all HTTP names will be entered in their
simplest and crudest forms. If you _start_ them out in this form, then
there's less space for error later.

Also punctuation characters are only going to confusing things for
data entry. My parents have sticky labels on their <Returnand <Tab>
keys, so how would you expect them to find a hyphen?

They _might_ make a domain name easier to read though. It can also
avoid the "powergenitalia" problem, where mis-reading is potentially
embarassing.
1. user-list.html VS userlist.html VS user_list.html
userlist.html
Also it's a good idea to avoid page names at all. Give your site a
sensible directory structure, use default pages throughout and don't
require users to ever remember or enter a URL that involves
remembering more than a domain name and simple directory name.

e.g. example.com/doggiechunks

rather than

example.com/competitions/default.asp?contest=doggiechunks_promo

(That 2nd is almost a real example, as printed on competition entry
forms by a major UK market-research aganecy)
Once they're inside the site and navigating by clicking links rather
than typing, then you have much more freedon.

<div id="main_content"... or <div id="mainContent".. or <div id="main-
content"..
DOM element names are used by programmers, for programmers. They're
not accessible to the punters beyond the 4th wall. So I'd suggest
camel case (look it up)

<div id="mainContent"..

Mar 26 '07 #5
Dan
On Mar 24, 3:22 am, "Richard Formby" <r...@invalid.comwrote:
The telephone test applies. Ring up your girlfriend
You're presuming the reader of your message has one?
user-list.html: userdashlist.html, userheiphenlist.html, userminus.html,
user_list.html.

user_list.html: userunderline.html, userunderscorelist.html, user-list.html.
userlist.html: userlist.html.
And maybe she'll add a superfuous "www." or ".com" somewhere in there
even if the actual URL doesn't have one, and perhaps at a point that
makes no logical or syntactic sense.

--
Dan

Mar 26 '07 #6
Dan
On Mar 26, 4:59 am, "Andy Dingley" <ding...@codesmiths.comwrote:
Also it's a good idea to avoid page names at all. Give your site a
sensible directory structure, use default pages throughout and don't
require users to ever remember or enter a URL that involves
remembering more than a domain name and simple directory name.
That kind of goes against the principles of logical structure I
generally espouse, where the directory structure should reflect
logical divisions of the site, in principle ones where there might be
lots of pages within the category eventually and hence an entire
directory makes sense rather than just a single file. If a
subdirectory is thought of as a drawer or shelf where items are
placed, one wouldn't want to allocate a separate drawer or shelf for
each little item; that seems awkward and wasteful.

Some thoughts on directory structure in Web sites: http://webtips.dan.info/subdir.html
e.g. example.com/doggiechunks
If that's a directory name, it would really be http://example.com/doggiechunks/
-- leaving out trailing slashes in directory names is one of my pet
peeves.

--
Dan

Mar 26 '07 #7
"Richard Formby" <rf@invalid.comwrites:
howa wrote:
>Q. Which naming convention for HTML stuffs you perferred?
>1. user-list.html VS userlist.html VS user_list.html

The telephone test applies. Ring up your girlfriend and tell her about your
brand new site:

user-list.html: userdashlist.html, userheiphenlist.html, userminus.html,
user_list.html.

user_list.html: userunderline.html, userunderscorelist.html, user-list.html.

userlist.html: userlist.html.
My personal domain fails that test *miserably*. Try explaining "dot-app.org"
over the phone some time...

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Mar 26 '07 #8
On 26 Mar 2007 11:50:31 -0700, "Dan" <da*@tobias.namewrote:
>On Mar 26, 4:59 am, "Andy Dingley" <ding...@codesmiths.comwrote:
>Also it's a good idea to avoid page names at all. Give your site a
sensible directory structure, use default pages throughout and don't
require users to ever remember or enter a URL that involves
remembering more than a domain name and simple directory name.

That kind of goes against the principles of logical structure I
generally espouse, where the directory structure should reflect
logical divisions of the site,
It doesn't go against it. Have a directory structure that reflects
whatever you want, then overlay other entry points onto it by redirects.
in principle ones where there might be
lots of pages within the category eventually and hence an entire
directory makes sense rather than just a single file.
You never have to lose multiplicity here, just use a further level of
subdirectory.

You don't even have to have directories in the filesystem here --
they're just a virtual structure in the URL. You can map them however
you want through .htaccess
If a
subdirectory is thought of as a drawer or shelf where items are
placed, one wouldn't want to allocate a separate drawer or shelf for
each little item; that seems awkward and wasteful.
Directories aren't drawers. You can pack slices of a namespace very
closely indeed. You don't have to cut dovetails to make them either.
>e.g. example.com/doggiechunks

If that's a directory name, it would really be http://example.com/doggiechunks/
Of course it would really be that. However that's an acceptable user
input, the redirect takes care of it, and it's one less thing for the
user to have to get right.
>-- leaving out trailing slashes in directory names is one of my pet
peeves.
That's reasonable as a site authoring issue, unreasonable as a
requirement to force upon users.

--
Cats have nine lives, which is why they rarely post to Usenet.
Mar 26 '07 #9
On Sat, 24 Mar 2007, Jukka K. Korpela wrote:
people will more probably use "user list"
(which matches "user-list" and "user_list" since Google treats special
characters as separators only)
http://www.google.com/search?q=%22user+list%22
http://www.google.com/search?q=user-list
http://www.google.com/search?q=user_list

--
In memoriam Alan J. Flavell
http://groups.google.com/groups/sear...Alan.J.Flavell
Mar 27 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
27
by: Derek | last post by:
The company where I work uses a naming convention that I have never used before. They use mixed-case letters for public member functions, but lower-case with underscores for the rest, like this:...
7
by: DEX | last post by:
Main page of my NC: http://www.ddmrm.com/coding/cpp/naming/cpp.naming.main.html Rules of my NC: http://www.ddmrm.com/coding/cpp/naming/cpp.naming.rules.html Comments are welcome. ...
3
by: clintonG | last post by:
Does the use of DTD, XML Schema and similar constructs adopt the use of C# naming conventions? If so how do I make the distinction of how to apply C# conventions with XML elements, attributes and...
4
by: Bob Quinn | last post by:
Hi, VB6 permitted the use of the space character in naming when enclosed with square brackets. This was particularly useful when creating enumerations such as: Enum FruitTypes End Enum ...
3
by: rsine | last post by:
I have searched around a little and have yet to find a naming convention for the string builder object. I really do not want to use "str" since this is for string objects and thus could be...
114
by: Jonathan Wood | last post by:
I was just wondering what naming convention most of you use for class variables. Underscore, "m_" prefix, camel case, capitalized, etc? Has one style emerged as the most popular? Thanks for...
35
by: Smithers | last post by:
Is it common practise to begin the name of form classes with "frm" (e.g., frmOneForm, frmAnotherForm). Or is that generally considered an outdated convention? If not "frm" what is a common or...
9
by: BillCo | last post by:
I'm coming from a MS Access background and so I'm very used to and comfortable with the hungarian (Leszynski et al) naming conventions. However, I'm getting started into my first SQL Server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.