Programming with GAP
- Remember that GAP is case-sensitive!
- Do not panic if you see
Error, Variable: 'FuncName' must have a value
.
- Care about names of variables and functions.
- Use command line editing.
- Use autocompletion instead of typing names of functions and
variables in full.
- Use
?
and ??
to view help pages.
- Set the default help format to HTML using
SetHelpViewer
.
- Use the
LogTo
function to save all GAP input and output
into a text file.
- If calculation takes too long, press -C to interrupt
it.
- Read ‘A First Session with GAP’ from the GAP Tutorial.
- GAP has a plethora of various immediate, positional and component
objects.
- List arithmetic is very flexible and powerful.
- Objects like lists and records are good to keep structured and
related data.
- Command line is good for prototyping; functions are good for
repeated calculations.
- Informative function names and comments will make code more readable
to your future self and to others.
- Beware of undeclared local variables!
- It is easy to create a test file by copying and pasting a GAP
session.
- Writing a good and comprehensive test suite requires some
effort.
- Make it right, then make it fast!
- Organise the code into functions.
- Create small groups one by one instead of producing a huge list of
them.
- Using
SmallGroupsInformation
may help to reduce the
search space.
- GAP is not a magic tool: theoretical knowledge may help much more
than the brute-force approach.
-
Positional objects may accumulate information about
themselves during their lifetime.
- This means that next time the stored information may be retrieved at
zero cost.
-
Methods are bunches of functions; GAP’s method
selection will choose the most efficient method based on the type
of all arguments.
- ‘No-method-found’ is a special kind of error with useful debugging
tools helping to understand it.