Convention/standard for naming files, functions and variables
fn42551 at fmi.uni-sofia.bg
Sat Jan 3 09:50:37 PST 2009
Matthew Burgess wrote:
> On Sat, 3 Jan 2009 04:08:26 +0200, "Angel Tsankov"
> <fn42551 at fmi.uni-sofia.bg> wrote:
>> I'd also like to know how to name functions in shell scripts,
>> which environment variables should be lowercase and which should be
> Naming functions in shell scripts should really follow the standard
> programming convention of calling them by the verb(s) that most
> describe what the function does. e.g. truncate(), replace(), find().
That's reasonable, but if the name contains more than one word do you use
lowerCamelCase, underscores, hyphens or smth else to separate the words?
> As for environment variables, standard convention is to have them in
With underscores delimiting the words, right?
> Again, I'm not sure there's any particular convention or even a style
> guide for this. There are some brief points at
> http://tldp.org/LDP/abs/html/unofficialst.html though.
Well, I think that there should be conventions for all sorts of things,
'cause conventions make life easier (or at least they should do so).
Does anybody have an idea why peope would mix underscores and hyphens like
More information about the lfs-chat