Eko Bono <firstname.lastname@example.org> dan Tedi Heriyanto <email@example.com>
v.0.0.3 : 21 May 2001
This programming guide is written to be used by software developers involved in GnuERP project to help them write software that is easy to maintain and read by others or by the programmers themselves.
For example if your variabel is used for counting saving account, the appropriate name shoud be saving, not xxx. :)
e.g : total_saving = 0;
If you want to name a constant please name it with all capital.
Please use four spaces for indenting.
Please name the file with something which best describe the content of the file. So if you have a file with content describe an Account Payable, the appropriate name would be acc_payable.php, not xxx.php
The following is a simple diagram to describe an ideal files organization :
I have a project called bejo, here is the directory structure :
bejo/stylethe source files located in bejo/
Functions that are used often should be saved in an include file, which has the following form :
Include files should be put in a directory called includes.
Include file should be invoked by other file with the following statement :
A one-liner comment should begin with //.
A block comment should begin with // too. Here is an example :
// function to add
// use : add(a,b,c)
Every class name should begin with a capital letter. e.g :
Class declarations and functions are saved in a file with the following structure
classname.class.phpSo for the class above, the appropriate class filename would be mysql.class.php
All class files should be saved in a separate directory under the name class.