For comments or questions about this site, contact us. Programming Rules and Conventions Abstract This is a description of programming rules and advise for how top-down programming is illustrated by which of the following write systems using Erlang. Note: This document is a preliminary document and is not complete. The requirements for the use of EBC’s “Base System” are not documented here, but must be followed at a very early design phase if the “Base System” is to be used.
Concentrate on trying to maximize the amount of clean code and minimize the amount of dirty code. Isolate the dirty code and clearly comment or otherwise document all side effects and problems associated with this part of the code. 5 Don’t make assumptions about what the caller will do with the results of a function Don’t make assumptions about why a function has been called or about what the caller of a function wishes to do with the results. The function will crash if Option neither normal nor all, and it should do that. The caller is responsible for supplying correct input. Trusted Worker: not allowed to have errors. The same is possible for most of the protocol handling software in the system.
It is an interface function for other modules. It is called from apply, spawn etc. Use different -export groupings and comment them accordingly. Often, however, we might like to simulate the effect of a hierarchical module structure. This can be done with sets of related modules having the same module prefix.
Did not find what they wanted? Try here
If, for example, an ISDN handler is implemented using five different and related modules. The domain of valid inputs to the function. That is, data structures of the arguments to the functions together with their meaning. The domain of the output of the function.
That is, all possible data structures of the return value together with their meaning. If the function implements a complicated algorithm, describe it. 1 or any non-obvious run time errors. Note the difference between failure and returning an error. Any side effect of the function. Purpose: Get various information from a process.
7 Data structures The record should be defined together with a plan text description. See “Don’t write deeply nested code” on page 23. See “Use tagged return values” on page 19. See “Function names” on page 24. See “Variable names” on page 23. See “Assign exactly one parallel process to each true concurrent activity in the system” on page 14. See “Use the process dictionary with extreme care” on page 20.
See “Flush unknown messages” on page 16. 10 Required Documents This section describes some of the system level documents which are necessary for designing and maintaining system programmed using Erlang. 1 Module Descriptions One chapter per module. 2 Message Descriptions The format of all inter-process messages except those defined inside one module. Description of the dynamic processes and their interfaces.