Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh best practices ?



On May 26, 10:49am, Marc Chantreux wrote:
}
} is there a document about zsh coding style and best practices?

Not really.

We should add something to Etc/zsh-development-guide discussing the
conventions for naming completion functions, widgets, etc. that go
into the distribution; I don't see anything in there about that.

} i want to adopt a convention for private functions and variables.
} Perl coders are using names beginning with _ but this is used for
} completion functions in zsh.
} 
} Is there another convention adopted?

It's a little more difficult with zsh than with perl because "private"
functions are still usually something you type on the command line,
not hidden in a libarary somewhere.  It's almost like asking if there
is a naming convention for files in the directories in $PATH.  The
completion system is a major exception to this.

One convention is to stick a "z" in front of anything that replaces a
similarly-named external command, but that doesn't help where the dist
has already adopted it.

I sometimes use *two* leading underscores, but only if I'm really worried
about a name collision.



Messages sorted by: Reverse Date, Date, Thread, Author