Difference between revisions of "DesignGuidelines"

From Lazarus wiki
Jump to navigationJump to search
m (Reverted edit of Vincent, changed back to last version by Smace)
(reverted to the cvs version.)
Line 1: Line 1:
 
== Coding Guidelines for Lazarus ==
 
== Coding Guidelines for Lazarus ==
  
This is for lazarus developers:
+
'''This is for lazarus developers:'''
  
'''Coding style:'''
+
;Coding style:
* Since one style is easier to read, Lazarus follows the Borland Coding style guide lines. Of course, almost anyone will find some points there, that are arguable less readable than other styles. That's ok, just try to follow at least 90%.  
+
- Since one style is easier to read, Lazarus follows the Borland Coding style
* Avoid unit circles. This makes it easier to navigate and when unit is growing allows to split it.
+
  guide lines. Of course, almost anyone will find some points there, that are
 +
  arguable less readable than other styles. That's ok, just try to follow at
 +
  least 90%.
 +
- Try to avoid unit circles. This makes it easier to navigate and when unit is
 +
  growing allows to split it.
  
'''Comments'''
+
;New files:
* Add comments in the start of each procedure/function or long/confusing routines. Of course, basic routines should not be commented.
+
- Every file should start with a header containing the license and a few lines
 +
  describing the content.
  
'''Identation'''
+
;Include files:
* The source code must not contain TABS, all identation must be done using SPACES and 2 spaces for each level, for example, 2,4,6,8,... etc
+
- should start with the {%MainUnit } directive
  
'''New files'''
+
;Packages:
* Every file should start with a header containing the license and a few lines describing the content.
+
- should have an .lpl entry in packager/globallinks/
* All file names must be in lowercase.
 
  
'''Include files'''
+
;Dialogs (modal forms):
* should start with the {%MainUnit } directive
+
- Close on Escape (if key not used otherwise)
 +
- Define default button and Return activates it (if key not used)
 +
- Medium to complex dialogs should be resizable and size is stored
  
'''Packages'''
+
;Main Menu Items:
* Should have an .lpl entry in packager/globallinks/
+
- Should have a key in keymapping.pp
  
'''Dialogs (modal forms)'''
+
''Proposals for improvement can be added to talk page (discussion)''.
* Close on Escape (if key not used otherwise)
 
* Define default button and Return activates it (if key not used)
 
* Medium to complex dialogs should be resizable and size is stored
 
 
 
'''Main Menu Items'''
 
* Should have a key in keymapping.pp
 

Revision as of 20:31, 22 February 2005

Coding Guidelines for Lazarus

This is for lazarus developers:

Coding style

- Since one style is easier to read, Lazarus follows the Borland Coding style

 guide lines. Of course, almost anyone will find some points there, that are
 arguable less readable than other styles. That's ok, just try to follow at
 least 90%.

- Try to avoid unit circles. This makes it easier to navigate and when unit is

 growing allows to split it.
New files

- Every file should start with a header containing the license and a few lines

 describing the content.
Include files

- should start with the {%MainUnit } directive

Packages

- should have an .lpl entry in packager/globallinks/

Dialogs (modal forms)

- Close on Escape (if key not used otherwise) - Define default button and Return activates it (if key not used) - Medium to complex dialogs should be resizable and size is stored

Main Menu Items

- Should have a key in keymapping.pp

Proposals for improvement can be added to talk page (discussion).