summaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2012-08-27 14:42:11 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2012-08-27 14:42:11 +0100
commitda65147754fcf006119907577ad61352640ad8bc (patch)
tree2602a1fa471a827cd0843ca4ac475393a7d95f99 /HACKING
parentce0f4eef9ae7451c671992aeed17cb00520f7f7b (diff)
docs: Add some more rules to the HACKING coding guidelines
Because rules are good.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING17
1 files changed, 17 insertions, 0 deletions
diff --git a/HACKING b/HACKING
index 6db61e0c..f1fac6b1 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
============