Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Before we get into the nitty-gritty of how to construct an application of either form, a few words on the interface you provide for the user are in order.
While programmers will use the interfaces you provide (real applications can be coded entirely in Glish), the primary audience is users. This means that your interfaces should emphasize simplicity, at least until there is a demand for a more capable and complicated interface.
Some of the issues we'd like you to consider are:
All user-invokable Glish functions must be entirely in lower case. Internal functions and variables may be in mixed case if you prefer. Generally words are run together, however you may use underscores to separate words if you are imitating a glish builtin (e.g. writing an is_image() function that apes the builtin Glish is_record() et al.)1. However, generally we prefer openfile() to open_file(). Generally, names should err on the side of being somewhat longer and unambiguous, however commonly typed names can be short since repetition will ensure that they are not obscure.
If you only expect one object of a type to typically exist the class name should be be a verb - imager. If you expect that more than one object of that class might be active at once it should be be a noun - table. In Glish, the most common common constuctor function should have the name of the class: mytable := table("file").
Class names will be normally be singular when the object refers to a single entity (image, table). Occasionally it might be plural if the object refers to a collection of some tye units.
You should try to use the same function names in your Glish objects that are used in other Glish objects that perform similar operations. This reduces the number of names that a user has to remember. You might break this rule however if the argument lists have to be very different in the two classes. Some names you should be aware of:
Sometimes you expect that the user will only need a single instance of a particular kind of object inside Glish, and you premake it for them so they don't have to. Call these objects defaulttype, for example, defaultlogger, and make then (and the constructor) const to avoid somone inadvertently changing them.
Generally you should not have ``null'' objects. A created object should always be fully manipulatable.