[vlmc-devel] commit: Updating HACKING ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Fri Oct 8 11:07:15 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Oct  8 10:56:04 2010 +0200| [71f9eefd428f2f5adcc376d4cd25cab80c20b6f5] | committer: Hugo Beauzée-Luyssen 

Updating HACKING

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=71f9eefd428f2f5adcc376d4cd25cab80c20b6f5
---

 HACKING |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/HACKING b/HACKING
index f944218..91a8429 100644
--- a/HACKING
+++ b/HACKING
@@ -67,7 +67,12 @@ Class, Function, Enums & Variable Naming
   * A getter is variable()
   * If it's a getter for a boolean, prefix with 'is', so isCondition()
   * A setter is setVariable( arg ).
+* Variable declaration must contain indentation between type and variable name
 
+Good:
+ | MyType       *ptr;
+Wrong:
+ | MyType *ptr;
 
 Best Practices
 --------------
@@ -207,6 +212,20 @@ Correct:
  |     pButton->setFlat( true );
  | }
 
+Moreover, try to use Qt's cast when applicable :
+ | MyParentClass    *ptr;
+ | MyClass          *ptr2 = qobject_cast<MyClass*>( ptr );
+ | if ( ptr2 != NULL )
+ | {
+ | ...
+ | }
+Is much faster than
+ | MyParentClass    *ptr;
+ | MyClass          *ptr2 = dynamic_cast<MyClass*>( ptr );
+ | if ( ptr2 != NULL )
+ | {
+ | ...
+ | }
 
 Commenting Out Code
 -------------------
@@ -301,3 +320,4 @@ URL). The complete license header needs to be written everytime.
 
 Thanks, now have fun!
   -- the VLMC developers
+



More information about the Vlmc-devel mailing list