C

Brace styles (K&R vs Allman)

Në shqip: Stilet e kllapave

ShpjegimiSQ

Programuesit e C-së debatojnë prej dekadash ku shkon kllapa {: në të njëjtin rresht (stili K&R, i zakonshëm në Linux) apo në rresht të ri (Allman). S'ka rëndësi cilin zgjedh — rëndësi ka që i gjithë projekti ta ndjekë.

EnglishEN

C programmers have argued for decades over where the { goes: on the same line (K&R style, common in Linux) or a new line (Allman). It doesn't matter which you pick — what matters is the whole project follows it.

Si ta mendosh

Si debati nëse letra e tualetit varet sipër apo poshtë.

Lexoje në anglisht

Like the debate over whether toilet paper hangs over or under.

Shembull kodic

if (x) {          // K&R
    y();
}
if (x)            // Allman
{ y(); }

Terma të lidhur