gjs r122 - trunk/doc



Author: johan
Date: Thu Nov 27 17:17:31 2008
New Revision: 122
URL: http://svn.gnome.org/viewvc/gjs?rev=122&view=rev

Log:
Update Style Guide for objects construction styling

Modified:
   trunk/doc/Style_Guide.txt

Modified: trunk/doc/Style_Guide.txt
==============================================================================
--- trunk/doc/Style_Guide.txt	(original)
+++ trunk/doc/Style_Guide.txt	Thu Nov 27 17:17:31 2008
@@ -76,15 +76,16 @@
 
 If your usage of an object is like an object, then you're defining "member variables." For member variables, use the no-quotes no-brackets syntax, that is, "{ bar: 42 }" and "foo.bar".
 
-If your usage of an object is like a hash table (and thus conceptually the keys can have special chars in them), use quotes and brackets, "{ 'bar' : 42 }", "foo['bar']".
+If your usage of an object is like a hash table (and thus conceptually the keys can have special chars in them), don't use quotes, but use brackets, "{ bar: 42 }", "foo['bar']".
 
 == Variable naming ==
 
-# We use javaStyle variable names, with AllCaps for type names and firstWordLowercase for variable and method names. However, when calling a C method with underscore-based names via introspection, we just keep them looking as they do in C for simplicity.
+# We use javaStyle variable names, with CamelCase for type names and lowerCamelCase for variable and method names. However, when calling a C method with underscore-based names via introspection, we just keep them looking as they do in C for simplicity.
 # Private variables, whether object member variables or module-scoped variables, should begin with "_".
 # True global variables (in the global or 'window' object) should be avoided whenever possible. If you do create them, the variable name should have a namespace in it, like "BigFoo"
 # When you assign a module to an alias to avoid typing "imports.foo.bar" all the time, the alias should be "const TitleCase" so "const Bar = imports.foo.bar;"
 # If you need to name a variable something weird to avoid a namespace collision, add a trailing "_" (not leading, leading "_" means private).
+# For GObject constructors, always use the lowerCamelCase style for property names instead of dashes or underscores.
 
 == Whitespace ==
 



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