View previous topic :: View next topic |
Is it acceptable to use uppercase letters in a module name? |
Yes |
|
45% |
[ 5 ] |
No |
|
54% |
[ 6 ] |
I don't know |
|
0% |
[ 0 ] |
|
Total Votes : 11 |
|
Author |
Message |
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Mon Nov 29, 2004 1:08 pm Post subject: Use of Uppercase Letters in Module Names |
|
|
I have noticed that a number of projects disobey Walter's D style guide for module names. That is, some modules are using upper case letters in the filenames. The original argument against mixing cases was to avoid "problems with case insensitive file systems."
Example:
IReader.d
or
ireader.d
Obviously, some people are not concerned about the filesystem problem. This little poll should bring peoples opinions on the matter to light. If you want to offer your opinion for or against the original naming style guide, please post a message that describes your perspective on the matter. |
|
Back to top |
|
|
SpottedTiger
Joined: 29 Nov 2004 Posts: 7 Location: Pennsylvania, USA
|
Posted: Mon Nov 29, 2004 10:05 pm Post subject: |
|
|
JJR thanks for reminding me about this...even though I read the D style guide, I was about to make the mistake of creating a module name with mixed case. It seems Windows just allows a lot more freedom in naming files than those darn Unix-like OSs, which I guess include the current Mac X OS too...that it's easy to forget the D style guide golden rule. Above, I've voted for all lowercase as the D style guide suggested. _________________ "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Mon Nov 29, 2004 11:51 pm Post subject: |
|
|
SpottedTiger wrote: | JJR thanks for reminding me about this...even though I read the D style guide, I was about to make the mistake of creating a module name with mixed case. It seems Windows just allows a lot more freedom in naming files than those darn Unix-like OSs, which I guess include the current Mac X OS too...that it's easy to forget the D style guide golden rule. Above, I've voted for all lowercase as the D style guide suggested. |
Hello SpottedTiger,
Funny you should mention that. I was not necessarily endorsing the D style guide. I just noticed that there were a number of respected D developers that didn't follow the style guide's convention in this regard. I was hoping to get some perspectives from people concerning this by the poll.
To tell you the truth, I find the mixed casing much easier to read and more descriptive. It also relates to the class naming style contained within the module. I have yet to see where the mixed casing can cause a serious issue on an OS. It could be that it does... I just haven't seen it yet.
In some cases I find that naming the module in lowercase creates names that are very difficult to read or that are just plain ugly.
But perhaps it's better to play it safe and stick to the rules. Maybe breaking them is for D gurus only.
Later,
John |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Tue Nov 30, 2004 2:16 am Post subject: |
|
|
I believe problems will arise when (in *nix) a module name use different case than the file. E.g
Filename:
foobar.d
Modulename:
FooBar
As long as the same case is used in both filename and modulename, there shouldn't ever be a problem (I would call it a compiler/some other-tool-bug.) Then again, I believe that the modulename is only used for filelookup when files are included for compilation through the -I switch instead of explicit inclusion on the command line. Several people have noted that the module name can be different from the filename, but then it cannot be found through the -I switch.
As for readility, I don't mind all-lower-case module names (in fact I've been using them myself) and have nothing against mixed-case names. |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Tue Nov 30, 2004 5:13 pm Post subject: |
|
|
Good points, lars. Thanks for your input. I think module names should alsways match the filenames. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Tue Nov 30, 2004 5:57 pm Post subject: |
|
|
I got the impression that on Linux a directory could contain each of these files:
somemodule.d
someModule.d
Somemodule.d
SomeModule.d
SOMEMODULE.D
That could cause me problems checking out such a directory from SVN under Windows.
I'd recommend we try to keep them all lowercase to help things work correctly across platforms. I think having this simple convention is useful. But the compiler won't require such a convention, so people can make their own choices. |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Tue Nov 30, 2004 6:28 pm Post subject: |
|
|
Hello Justin,
You are correct. Those are all different filenames on Linux.
Wouldn't that only cause trouble on windows if you tried to use several of these filenames in the same directory space? Wouldn't that be considered very bad style to try to keep multiple files in the same directory with the case being the only differentiating factor? Is the risk of that happening so great that we should not attempt a mixed cased naming scheme?
So we can accomplish safe practices by either:
1) ditching bad naming schemes
2) ditching mixed case naming schemes for cross-OS consistancy
Either way, the goal could be accomplished.
Windows lack of case-specificity is a severe OS limitation. But at least it still allows the filenames to use mixed casing.
But there is an instance where the problem could be significant (if D were someday ported): if there are any OSes out there that completely eliminate the mixed casing (automatically save a filename to all caps or all lower case), we could have a big problem. That way the module name declared inside would no longer maintain consistancy with the filename. This is probably what Walter was predicting. Currently, D hasn't been ported to any such OS.
I see arguments going both ways. So I'm still sitting the fence with this one.
Thanks for your input, Justin.
- John |
|
Back to top |
|
|
|