summaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
authorTravis Reitter <travis.reitter@collabora.co.uk>2010-12-27 17:22:21 -0800
committerTravis Reitter <travis.reitter@collabora.co.uk>2010-12-29 17:08:37 -0800
commitb93b4445e87bc645c1b6c1425deb17a99c27304c (patch)
tree9c1e5bcbe07e159562fe0bafc2c6ddc95f7891fc /HACKING
parent531ad2e2bab35e5aaa0be7fdb0eb12c8f6b5bcff (diff)
Maximize use of the 'var' keyword.
This is used whenever a variable: 1. is declared and initialized in the same line AND 2. would not avoid a copy by using the 'unowned'. In the future, we may be able to declare variables 'unowned var', in which case this point won't matter. See bgo#638199. The net benefit is less noise on variable declaration lines. Helps bgo#629083
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING6
1 files changed, 6 insertions, 0 deletions
diff --git a/HACKING b/HACKING
index 7e9e4335..b373c84f 100644
--- a/HACKING
+++ b/HACKING
@@ -82,3 +82,9 @@ Vala-specific rules
6. Private and internal class functions should begin with a _ (public functions
should not begin with a _). This is to make non-public functions instantly
recognizable as such (which helps readability).
+
+7. Maximize use of the 'var' variable type. This shortens the declarations where
+ it's valid, reducing noise.
+
+ Rarely, the use of 'var' can obscure the effective type of the variable. In
+ this case, it's acceptable to provide an explicit type.