[folks] docs: Add some more rules to the HACKING coding guidelines



commit da65147754fcf006119907577ad61352640ad8bc
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Aug 27 14:42:11 2012 +0100

    docs: Add some more rules to the HACKING coding guidelines
    
    Because rules are good.

 HACKING |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/HACKING b/HACKING
index 6db61e0..f1fac6b 100644
--- a/HACKING
+++ b/HACKING
@@ -107,6 +107,23 @@ Vala-specific rules
 
     This makes scope immediately clear, helping readability.
 
+11. Use nullable types correctly. This helps readability (and makes the
+    programmer's intentions clearer about whether a variable may be null). The
+    ultimate goal is for folks to compile correctly with Valaâs strict-non-null
+    mode enabled (https://live.gnome.org/Vala/Tutorial#Strict_Non-Null_Mode).
+
+12. Place the (private) member variable declaration for a variable which backs a
+    property next to the (public) property declaration, rather than at the top
+    of the file. This keeps as much of the code pertaining to a property as
+    possible in one location.
+
+13. Initialise member variables when declaring them, if possible, rather than in
+    a constructor or construct{} block. If itâs not possible to initialise a
+    member variable at declaration time (e.g. because its value depends on
+    another variable), perform the initialisation in a construct{} block rather
+    than a specific constructor. This means that the initialisation doesnât have
+    to be copied between multiple alternate constructors.
+
 Build health
 ============
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]