Php – Is it safe to use CamelCased file names

PHP

I'm developing a simple CMS which I'd like to make it open source.

For the file structure, do you think it's safe to use names like:

AppData
FileUploads

instead of

app-data
file-uploads

?

Because I heard some servers have problems with the camelCase.

Best Answer

Anytime you use mixed case in file names on *nix systems you are asking for human error to slip in. All lower case is easier to type in and not make mistakes. It also causes subtle errors and undefined type behaviors on Case Preserving but Case Insensitive file systems the default modes of NTFS and HFS+.

I would be more concerned about using the - character in file names than mixed case. - is a command line switch and I have have experienced some extremely subtle issues with shells and command line programs where this will need to be escaped, this was a long while ago and related to PowerShell parsing command line args to other command line programs, but still I wouldn't do it just to avoid tracing down silly things like that.

Traditionally _ is the preferred word separator in file and directory names.

There is actually a specification for Unicode Word Boundaries.

Related Topic