» it.Convenzioni per lo stile del codice
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

it.Convenzioni per lo stile del codice

English | French | Spanish

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.

Per una migliore leggibilità e standardizzazione del codice di vvvv, dovremmo tutti conformarci agli stili di codice qui presentati.

MAIUSCOLE\minuscole, "Casing"

Definizioni

Pascal Casing

 RedHotChilliPeppers

Camel Casing

 redHotChilliPeppers

Classi

  • Pascal Casing
//buono
class RedHot
 
//no buono
class TRedHot
class redhot

Interfacce

  • cominciate con una I (per Interfaccia) e poi Pascal Casing
//buono
interface IRedHot
 
//no buono
interface RedHotInterface
interface Iredhot

Variabili di Classe

  • cominciate con una F (per Field, campo) e poi Pascal Casing
//buono
int FChilliPepper
 
//no buono
int ChilliPepper 
int FchilliPepper

Variabili Locali, Argomenti delle Funzioni

  • Camel Casing
//buono
int redPepper;
void Foo(int barCode);
 
//no buono
int Redpepper;
int RedPepper;
void Foo(int BarCode);

Variabili Globali

  • cominciate con una G e poi Pascal Casing
//buono
int GChilliPepper;
 
//no buono
int ChilliPepperGlobal;
int GchilliPepper;

Funzioni

  • Pascal Casing
//buono
PlayMusic();
 
//no buono
playMusic();

Eventi

  • cominciate con On.. e poi Pascal Casing
//buono
OnExplode
 
//no buono
Explode
Onexplode

Eventi di Callback

  • vengono chiamati come gli eventi corrispondenti
  • terminano con ..CB
//buono
ExplodeCB()
 
//no buono
ExplosionCB()
explodeCB()

Parentesi

  • le parentesi sono sempre in una nuova riga
//buono
if true then
{ 
 ...
};
 
//no buono
if true then { ... };
if true then {
   ...
 };

Indentazione

  • usate sempre 4 spazi

Spaziatura

  • c'è sempre un singolo spazio dopo una virgola o un punto e virgola, mai prima
//buono
MyFunction(a, b);
 
//no buono
MyFunction( a , b );
  • singoli spazi circondano gli operatori (eccetto operatori unari come imcremento e not logico)
//buono
a = b;                       
for (int i = 0; i < 10; ++i) 
 
//no buono
a=b;                             
for (int i=0; i<10; ++i)

Altre linee guida

Tenete presente che certe incompatibilità con le guide proposte sotto (che pure differiscono tra loro) sono deliberate.

Mono Coding Guidlines

.Net Design Guidlines

Sharp Develop Coding Guidlines

anonymous user login

Shoutbox

~3mth ago

joreg: END OF SHOUTBOX! As this page has is now legacy, it will no longer feature new content. For latest news, see: http://vvvv.org

~4mth ago

joreg: vvvvTv S0204 is out: Custom Widgets with Dear ImGui: https://youtube.com/live/nrXfpn5V9h0

~4mth ago

joreg: New user registration is currently disabled as we're moving to a new login provider: https://visualprogramming.net/blog/2024/reclaiming-vvvv.org/

~4mth ago

joreg: vvvvTv S02E03 is out: Logging: https://youtube.com/live/OpUrJjTXBxM

~4mth ago

~4mth ago

joreg: Follow TobyK on his Advent of Code: https://www.twitch.tv/tobyklight

~4mth ago

joreg: vvvvTv S02E02 is out: Saving & Loading UI State: https://www.youtube.com/live/GJQGVxA1pIQ

~4mth ago

joreg: We now have a presence on LinkedIn: https://www.linkedin.com/company/vvvv-group

~5mth ago

joreg: vvvvTv S02E01 is out: Buttons & Sliders with Dear ImGui: https://www.youtube.com/live/PuuTilbqd9w

~5mth ago

joreg: vvvvTv S02E00 is out: Sensors & Servos with Arduino: https://visualprogramming.net/blog/2024/vvvvtv-is-back-with-season-2/