» fr.Conventions et style de code
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

fr.Conventions et style de code

English | Italian | Spanish

Afin de faciliter la lecture et la standardisation du code dans vvvv, merci de suivre ces quelques conventions :

Casse

Définitions

Pascal Casing

 RedHotChilliPeppers

Camel Casing

 redHotChilliPeppers

Classes

  • Pascal Casing
//bien
class RedHot
 
//pas bien
class TRedHot
class redhot

Interfaces

  • commencent par un I (comme Interface) et s'écrivent en Pascal Casing
//bien
interface IRedHot
 
//pas bien
interface RedHotInterface
interface Iredhot

Variables de classe

  • commencent par un F (comme Field) et s'écrivent en Pascal Casing
//bien
int FChilliPepper
 
//pas bien
int ChilliPepper 
int FchilliPepper

Variables locales, arguments

  • Camel Casing
//bien
int redPepper;
void Foo(int barCode);
 
//pas bien
int Redpepper;
int RedPepper;
void Foo(int BarCode);

Variables globales

  • commencent par un G et s'écrivent en Pascal Casing
//bien
int GChilliPepper;
 
//pas bien
int ChilliPepperGlobal;
int GchilliPepper;

Fonctions

  • Pascal Casing
//bien
PlayMusic();
 
//pas bien
playMusic();

Événements

  • commencent par On.. et s'écrivent en Pascal Casing
//bien
OnExplode
 
//pas bien
Explode
Onexplode

Callbacks

  • portent le même noms que les événements auxquels ils font référence
  • mais terminent par ..CB
//bien
ExplodeCB()
 
//pas bien
ExplosionCB()
explodeCB()

Parenthèses

  • les parenthèses sont toujours sur une nouvelle ligne
//bien
if true then
{ 
 ...
};
 
//pas bien
if true then { ... };
if true then {
   ...
 };

Indentation

  • utilisez toujours 4 espaces

Espacements

  • il y a toujours un espace après un point ou un point-virgule, jamais avant
//bien
MyFunction(a, b);
 
//pas bien
MyFunction( a , b );
  • un espace de part et d'autre des opérateurs (sauf les opérateurs unaires comme l'incrémentation ou le NOT logique)
//bien
a = b;                       
for (int i = 0; i < 10; ++i) 
 
//pas bien
a=b;                             
for (int i=0; i<10; ++i)

Autres guidelines

Notez que les différences avec les autres guides listés ci-dessous (qui différent aussi entre eux) sont volontaires.

Mono Coding Guidlines

.Net Design Guidlines

Sharp Develop Coding Guidlines

anonymous user login

Shoutbox

~2d ago

joreg: The summer season of vvvv workshops at The NODE Institute is out: https://thenodeinstitute.org/ss24-vvvv-intermediates/

~2d ago

domj: If you happen to be in Prague, come join us at the Schema workshop on Thursday 25.4. :) https://www.facebook.com/events/395516526614988/?ti=ls

~14d ago

joreg: Postponed: Next vvvv beginner course starting April 29: https://thenodeinstitute.org/courses/vvvv-beginner-class-summer-2024/

~1mth ago

~1mth ago

joreg: The Winter Season of vvvv workshops is now over but all recordings are still available for purchase: https://thenodeinstitute.org/ws23-vvvv-intermediates/