Solved

File Naming Question

Posted on 2006-11-18
4
189 Views
Last Modified: 2008-02-07
Hi, This may seem like a trivial question, but i was wondering if it is bad practice to use camelCaps for naming public php files on a linux box. I mention linux because on windows obviously  fileName.php and filename.php makes no difference. So really i guess what i am concerned about is that users may try to access filenames directly and think that the server is down etc when really it is not, instead they are using the wrong case. ( should i even worry about that?)

Thanks for any suggestions!
0
Comment
Question by:amagondes
  • 2
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
yodercm earned 75 total points
ID: 17972787
I guess the best way to handle this is to make everything lower case all the time, then users never have to worry about which letters should be capitalized.  At least be 100% consistant in whatever you decide, so users don't have to think about it.  If you capitalize words within the name, then capitalize ALL words within the name ... that is, use either FileName or filename, but don't use fileName.

Just my opinion. :))
0
 
LVL 19

Assisted Solution

by:VoteyDisciple
VoteyDisciple earned 50 total points
ID: 17972969
For a variety of usability reasons, I always use (and recommend using) all lowercase, with hyphens to separate words.

1.  Just having all lowercase is, as we all know, hard to read, so that's out right off the bat.

2.  Mixed casing can screw up users typing the URL by hand who don't realize case matters.  Since case so seldom matters in ordinary computer use a lot of novice users will completely fail to recognize either FileName or fileName as requiring any special attention at all.

3.  Underscores, an otherwise viable alternative, blend in with the underlining that usually goes with links (even if the URL isn't actually underlined we're kinda used to seeing links underlined so we gloss over it).

4.  For more saavy users it's just as easy to say "experts exchange with a hyphen" as "experts exchange, all one word" and both are easier than the nonsense of "experts exchange, all one word, capital E on Exchange, lowercase e on experts" which everyone will promptly forget and just Google instead.


So, http://www.example.com/files/are-cool/with-hyphens.html
... is a good structure.
0
 
LVL 27

Expert Comment

by:yodercm
ID: 17973001
I strongly disagree that using all lowercase is "out right off the bat".   All lowercase is what most of the internet uses, what most people are used to, and far easier to type than adding in either hyphens or underscores.  It may be your personal preference, VoteyDisciple, but please don't denigrate the opinions of others when you give your own.

I stand by my statement that all lowercase is by far the best if your users have to type the URL.
0
 
LVL 19

Expert Comment

by:VoteyDisciple
ID: 17973082
Sheesh, I just said that's what I do and recommend doing, and I gave my reasons for it.  Me saying so doesn't make your recommendation any less valuable or correct, and if we wait around another few minutes somebody's sure to come along and provide five or six really good reasons that my way's pretty dumb and that therefore the best thing to do is only ever use one-word filenames in one-word directories (probably to enhance RFC 918346 compliance -- an RFC that I now challenge somebody on EE to write, just 'cause it'd be amusing).

Google, for the wealth of "experts"-containing e-mails that show up in my GMail inbox, has lately taken to reminding me of Roosevelt's quote, "There are as many opinions as there are experts."
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now