Actually, as a sign of how completely odd my coding gets... I don't like using dashes to connect words, because it could become a subtraction statement.
I think I'm an OK coder, but don't trust me to write air-traffic or missle defense programs.
function and variable names should be camel-cased. website URLs should be all lowercase and words should be separates using hypens.
reason: people have a habit of typing in lowercase with the web (because that's how it normally works anyway) so if your URL is in uppercase it will fail on Unix boxes (which are case sensitive and which is what most the web uses) but to the user it won't seem like they entered in the wrong URL because to them it's the same save the case. they won't understand the distinction and consequently they'll think the site is broken.
as for using hyphens, these are better than underscores. why? because underscores can be hidden by an hyperlink's text decoration (underline) and therefore to the user it looks like spaces are separating words and not underlines.
I don't know, but have noticed that it can make a difference in when scripting the commandLine; compare:
Code:
var wshShell = WScript.CreateObject("WScript.Shell");
// must be escaped...
wshShell.Run("%comspec% /k \"%homedrive%\\Temp\\spaces in path\\echo.wsf\"");
// no need to escape...
wshShell.Run("%comspec% /k %homedrive%\\Temp\\under_scored_path\\echo.wsf");
__________________
*this message will self destruct in n-seconds*
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
Quote:
Originally Posted by codegoboom
I don't know, but have noticed that it can make a difference in when scripting the commandLine; compare:
Code:
var wshShell = WScript.CreateObject("WScript.Shell");
// must be escaped...
wshShell.Run("%comspec% /k \"%homedrive%\\Temp\\spaces in path\\echo.wsf\"");
// no need to escape...
wshShell.Run("%comspec% /k %homedrive%\\Temp\\under_scored_path\\echo.wsf");
The right term I think should be "quoted" and not "escaped" as escaping can be avoided if single quotes are used as string delimiter. The command parameter that is a file path must be "quoted" to make the path with spaces be treated as single parameter.
I use all characters I feel appropriate, where they are appropriate, in file names. Windows is sadly limited in this aspect. You can't name files with '"', '?', '\', '|', ':' , '/', '<', '>' in the file name. This makes it hard to appropriately name files. For example, if an example in a compound document uses the label "Example 14 - Is 2*(3+5)/3 a real number?", then an appropriate file name for that example would be just that. This is where it's nice to own a Mac (which disallows ':' but not much else)... and then you can do away with file extensions for media type determination, too.
Binding media type (which should not change just because the name does - if it's the same content, it is of the same media type) to the file name was one of the worst design decisions Microsoft did with DOS - mostly because they haven't until recently learnt the lesson and understood how bad a decision it really was. They have had many chances to improve on the file system metadata storage, but not done anything at any of those times.