Solved

File Naming Question

Posted on 2006-11-18
4
208 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

861 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