Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why shouldn't I use spaces in file names when I can use a code equivalent? [closed]

I've read all over the place NOT to use spaces in file names intended for use on the Web, e.g. URLs.

I don't understand what's wrong with using "%20" to replace them when referring to the name in my code. It seems more appropriate to use this replacement because I'm then preserving semantic meaning of my file name.

?

like image 322
Pup Avatar asked Jul 07 '09 17:07

Pup


3 Answers

It's user friendly to have readable URLs.

For example, this page could have been:

http://stackoverflow.com/questions/1093611/why%20shouldnt%20i%20use%20spaces%20in%20file%20names%20when%20i%20can%20use%20a%20code%20equivalent

Not nearly as readable at first glance.

like image 183
Will Eddins Avatar answered Oct 11 '22 18:10

Will Eddins


first off, it is not that you can't it is that you shouldn't. It is not best practice to have spaces in your file names, it just complicates things, period.

second, it is harder for someone to manually type in the address if they wish.

i.e. "hey go to my site and get my resume at" www.... /my%20resume

just my $0.02

like image 22
Robert Greiner Avatar answered Oct 11 '22 20:10

Robert Greiner


It's ugly. Aesthetics do matter for anything a user sees.

like image 41
Kristopher Johnson Avatar answered Oct 11 '22 19:10

Kristopher Johnson