Outils pour utilisateurs

Outils du site


fr:devel:coding-style

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
fr:devel:coding-style [2013/02/10 14:54] – initialisation niconilfr:devel:coding-style [2021/02/13 11:23] (Version actuelle) – modification externe 127.0.0.1
Ligne 9: Ligne 9:
 <note tip>Seules les différences avec le standard Qt sont décrits dans cette page.</note> <note tip>Seules les différences avec le standard Qt sont décrits dans cette page.</note>
  
-===== General rules =====+===== Règles générales =====
  
-  - Remember to add //tr()// around text that can be translated+  - Ne pas oublier //tr()// autour des chaînes concernées par la traduction
-  - Commit often, +  - Commiter souvent. 
-  - Syntax when fixing a Redmine declared bug : [explanation] fixes bug #[bug number here] +  - Coder en C++, pas en C. 
-  - Code in C++, not in C. +  - Ne jamais dupliquer du code, c'est le signe d'un code peu efficient si le cas se produit, prenez l'air et repensez la structure de votre code. 
-  - Never copy & paste code, if you want to do it that means that something is wrong re-think the code structure+  - Adaptez vous au projet auquel vous contribuez.
-  - Adapt yourself to the project for which you are developing.+
  
-===== Comments =====+===== Commentaires ===== 
 + 
 +//[A traduire]//
  
 Only comment when needed, usually naming the variables, classes and methods correctly Only comment when needed, usually naming the variables, classes and methods correctly
Ligne 30: Ligne 31:
 </code> </code>
  
-===== Class attributes ===== +===== Attributs de classe =====
  
 +//[A traduire]// 
   - Class attributes are always private, use getters and setters to access them.   - Class attributes are always private, use getters and setters to access them.
   - Class attributes start with a lower m.<code>   - Class attributes start with a lower m.<code>
Ligne 42: Ligne 43:
 </code> </code>
  
-===== Setters and getters =====+===== Méthodes d'affectation et de récupération des attributs =====
  
 +[NdT] les mots //getter// et //setter// ont été conservés
 +
 +//[A traduire]// 
   - Setters start with “set”.   - Setters start with “set”.
   - Getters don't start with “get”.   - Getters don't start with “get”.
Ligne 59: Ligne 63:
 ===== Indentation ===== ===== Indentation =====
  
 +//[A traduire]// 
   - Indentation is made with tabulations, not spaces. The tabulation character is designed for that. Spaces are made to separate words, so using spaces to indent in 2010+ with modern editors makes no sense.   - Indentation is made with tabulations, not spaces. The tabulation character is designed for that. Spaces are made to separate words, so using spaces to indent in 2010+ with modern editors makes no sense.
   - The tabulation and the indentation size should be set to <wrap hi>**4**</wrap>, warning : this is not the default setting in QtCreator !   - The tabulation and the indentation size should be set to <wrap hi>**4**</wrap>, warning : this is not the default setting in QtCreator !
  
-===== Declaring variables =====+===== Declaration de variables =====
  
-  - Classes doesn't start with any special letter.+//[A traduire]// 
   - Variables are declared when used, not at the start of a block like in C.<code>   - Variables are declared when used, not at the start of a block like in C.<code>
 // Wrong // Wrong
Ligne 82: Ligne 87:
 } }
 </code> </code>
 +  - Classes doesn't start with any special letter.
  
-===== Braces =====+===== Accolades =====
  
 +//[A traduire]//
   - The correct way to write an if statement :<code>   - The correct way to write an if statement :<code>
 //Correct //Correct
Ligne 120: Ligne 127:
 </code> </code>
  
-===== Switch statements =====+===== Blocs liés à une instructtion switch =====
  
 +//[A traduire]//
   - Every case **does not** have to have a break (or return) statement at the end or a comment to indicate that there’s intentionally no break   - Every case **does not** have to have a break (or return) statement at the end or a comment to indicate that there’s intentionally no break
  
-===== Line breaks =====+===== Retour à la ligne =====
  
 +//[A traduire]//
   - No numerical limit to the length of a line, just keep it not “too long”.   - No numerical limit to the length of a line, just keep it not “too long”.
  
fr/devel/coding-style.1360508077.txt.gz · Dernière modification : 2021/02/13 11:23 (modification externe)