First session with GAP
|
Use command line editing.
Use autocompletion instead of typing names of functions and variables in full.
Use ? and ?? to view help pages.
Premature optimization is the root of all evil!
Premature optimization is the root of all evil!!
Functional programming can make code not only concise but also unreadable if nested too much.
Permutations are multiplied from left to right.
|
Some more GAP objects
|
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.
|
Functions in GAP
|
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!
The break loop can be extremely helpful for debugging.
You can interrupt computations by hitting Ctrl + C.
|
Using regression tests
|
It is easy to create a test file by copying and pasting GAP session or use the LogTo-command.
Writing a good test suite is an art in itself.
Make it right, then make it fast!
|
Small groups search
|
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.
Determining the isomorphism type of a group.
GAP is not a magic tool: theoretical knowledge may help much more than brute-force approach.
|
Attributes and Methods
|
Positional objects may accumulate information about themselves during their lifetime. This is done by using Attributes.
This means that next time the stored information may be retrieved at zero costs.
Methods are bunches of functions; the method selection will choose the most efficient method based on the type of all arguments.
|