diff options
author | Travis Reitter <travis.reitter@collabora.co.uk> | 2010-12-27 17:22:21 -0800 |
---|---|---|
committer | Travis Reitter <travis.reitter@collabora.co.uk> | 2010-12-29 17:08:37 -0800 |
commit | b93b4445e87bc645c1b6c1425deb17a99c27304c (patch) | |
tree | 9c1e5bcbe07e159562fe0bafc2c6ddc95f7891fc /HACKING | |
parent | 531ad2e2bab35e5aaa0be7fdb0eb12c8f6b5bcff (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-- | HACKING | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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. |