» Convenciones.EstiloDeCodigo
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

Convenciones.EstiloDeCodigo

English | French | Italian

The original english version of this page is newer and may contain information this translation does not have! Click here to view the english version.

Para lograr una mejor legibilidad y estandarización del código asociado a vvvv, es necesario adherirse a los lineamientos de estilo de código listados a continuación:

Mayúsculas y minúsculas

Definiciones

Pascal Casing

 RedHotChilliPeppers

Camel Casing

 redHotChilliPeppers

Clases

  • Pascal Casing
//correcto
class RedHot
 
//incorrecto
class TRedHot
class redhot

Interfaces

  • iniciar con una I (por Interface) y continuar con Pascal Casing
//correcto
interface IRedHot
 
//incorrecto
interface RedHotInterface
interface Iredhot

Variables de Clase

  • iniciar con una F (por Field) y continuar Pascal Casing
//correcto
int FChilliPepper
 
//incorrecto
int ChilliPepper 
int FchilliPepper

Variables Locales, Argumentos de Funciones

  • Camel Casing
//correcto
int redPepper;
void Foo(int barCode);
 
//incorrecto
int Redpepper;
int RedPepper;
void Foo(int BarCode);

Variables Globales

  • iniciar con una G y continuar con Pascal Casing
//correcto
int GChilliPepper;
 
//incorrecto
int ChilliPepperGlobal;
int GchilliPepper;

Funciones

  • Pascal Casing
//correcto
PlayMusic();
 
//incorrecto
playMusic();

Eventos

  • iniciar con On.. y continuar con Pascal Casing
//correcto
OnExplode
 
//incorrecto
Explode
Onexplode

Callbacks de Eventos

  • llevan el nombre de sus Eventos correspondientes
  • terminan con ..CB
//correcto
ExplodeCB()
 
//incorrecto
ExplosionCB()
explodeCB()

Llaves

  • las llaves siempre en una línea nueva
//correcto
if true then
{ 
 ...
};
 
//incorrecto
if true then { ... };
if true then {
   ...
 };

Indentación

  • utilizar siempre 4 espacios

Espaciado

  • siempre hay un único espacio después de una coma o punto y coma, nunca antes
//correcto
MyFunction(a, b);
 
//incorrecto
MyFunction( a , b );
  • espacios únicos rodean a los operadores (excepto operadores unarios como el incremento o el NOT lógico)
//correcto
a = b;                       
for (int i = 0; i < 10; ++i) 
 
//incorrecto
a=b;                             
for (int i=0; i<10; ++i)

Guías de Código Adicionales

Note que algunas incompatibilidades con las guías que se listan a continuación (las cuales difieren entre sí a su vez) son deliberadas.

Mono Coding Guidlines

.Net Design Guidlines

Sharp Develop Coding Guidlines

anonymous user login

Shoutbox

~5d ago

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

~5d 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

~17d ago

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

~1mth ago

~2mth 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/