Go to the first, previous, next, last section, table of contents.
The following are some general items of advice; you don't have to follow
them but they are the result of experience!
-
Jade only has one name-space for all the symbols ever created, this could
lead to naming clashes if care isn't taken.
When you write a program all the symbols it creates should be prefixed
by a name derived from the name of the program in some way. For example,
in the program `isearch.jl' all functions and variable names are
prefixed by the string `isearch-', giving
isearch-cancel
and so on. Note that the prefix doesn't have to be the exact name of the
file, the program `buffer-menu.jl' uses the prefix `bm-'.
The entry points to a module (i.e. the names of the commands it provides)
should not have a prefix, simply give them a descriptive name (but
try not to make it too long!).
Don't bother giving local variables these prefixes unless they are used
by several functions in the program.
-
Use the
recursive-edit function as little as possible; it can be
very confusing for the user! When at all possible use keymaps to
create user interfaces.
-
Use the Lisp mode to indent your programs; not only does it save a lot
of time it also makes it easier for other people to read them.
-
Errors should always be reported by either
error or signal,
don't just print a message or call beep.
-
Don't redefine existing functions unless absolutely possible: try to
use hooks. If there is no hook where you want one, mail me about it and
I may put one in the next release.
-
Don't compile your program until you're sure it works! The debugger only
works properly with uncompiled code.
-
Use constants sparingly: personally, I only use them where the constants
are numeric.
-
Remember to define macros before they are used, otherwise they won't be
compiled inline. The same can happen if you don't
require a file
that a macro is defined in before using the macro definition.
-
As I said in the compilation tips (see section Compilation Tips), try to
use iteration instead of recursion. Also the
memq and assq
types of functions can be used to search some types of list structures
very quickly.
-
When writing modes don't bind any unmodified keys to the prefix Ctrl-c,
these are reserved for customisation by users.
Go to the first, previous, next, last section, table of contents.