User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
development:editor-gtk:code-formatting-conventions [2019/08/15 00:52]
fdelapena removed
— (current)
Line 1: Line 1:
-====== Editor-GTK code formatting conventions ====== 
-Editor-GTK conventions are like player conventions,​ but with some changes since the editor is written in Vala. 
-All upper case, with underscores as name separators, but no leading/​trailing underscores:​ 
-<code csharp>​THIS_IS_A_CONSTANT</​code>​ 
-==Type names== 
-Clases should be UpperCamelCase. 
-<code csharp>​class MainWindow : Gtk.Window { 
-class Armor : Item {</​code>​ 
-Functions should be lower case with underscores as word separators. ​ 
-<code csharp>​void this_is_a_function() {</​code>​ 
-Properties should have getter and setter defined: 
-<code csharp>​class Foo { 
-    private int random_int { public get; private set; } 
-    public bool has_something { public get; public set; } 
-Variables should be lower case with underscores as word separators. 
-<code csharp>​int this_is_a_variable;</​code>​ 
-Use /* This style */ preferably. 
-Please use Valadoc comment style (Javadoc like) for code documentation. 
-==License File Header== 
-Remember to copy (from any other existing file) the license header to all new created files. 
-==Special comments== 
-<code csharp>//​ TODO: what is left to do 
-// FIXME: what code and in what circumstances it does not work, and if possible why it does not work well</​code>​