summaryrefslogtreecommitdiff
path: root/README.NAMING
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2010-08-02 07:14:53 -0700
committerDaniel Burrows <dburrows@debian.org>2010-08-02 07:14:53 -0700
commit671252e8731f316952687fe6c5c2b026de4073af (patch)
tree1a7779768c417eceb5fb45ba0c923f3a86455f16 /README.NAMING
parent03034df9dd7d6e6be184ef132b9326a26a076536 (diff)
downloadaptitude-671252e8731f316952687fe6c5c2b026de4073af.tar.gz
Add some notes on how identifiers are chosen in aptitude.
Diffstat (limited to 'README.NAMING')
-rw-r--r--README.NAMING46
1 files changed, 46 insertions, 0 deletions
diff --git a/README.NAMING b/README.NAMING
new file mode 100644
index 00000000..cffd7324
--- /dev/null
+++ b/README.NAMING
@@ -0,0 +1,46 @@
+Identifier styles in aptitude.
+
+These are not followed 100%, but should generally be used for new
+code.
+
+1) Capitalization
+
+Class names:
+
+ class some_class_name
+ {
+ };
+
+Template parameters:
+
+ template<typename TemplateParam1, typename TemplateParam2>
+ class foo { ... };
+
+ template<typename Key, typename Val>
+ class my_super_map { ... };
+
+Note that single-character names are not used. They should only be
+used if the type is truly unimportant, such as in a container:
+
+ template<typename T>
+ class my_super_list { ... };
+
+Member variables and member functions:
+
+ class foo
+ {
+ int some_member_variable;
+ };
+
+ In some parts of aptitude, camelCase creeps in here; it is
+ acceptable for new code, but dispreferred.
+
+Macros:
+
+ #define MY_MACRO
+
+2) Accessors
+
+For value classes, aptitude follows the get_NAME() pattern to retrieve
+the value of the property NAME. If there is a corresponding mutator,
+use set_NAME(), but normally immutable objects are preferred.