3 Improve code formatting
source | link

Use ternary operators:

if(a == 2a==2){
    some code gets executed...;
     code;} else {
    some other code gets executed...;
     code;}

can be abbreviated to this:

(a == 2 a==2? some code : some other code);

Shorter, huh?

Use ternary operators:

if(a == 2){
    some code gets executed...;
     } else {
    some other code gets executed...;
     }

can be abbreviated to this:

(a == 2 ? some code : some other code);

Shorter, huh?

Use ternary operators

if(a==2){some code;}else{some other code;}

can be abbreviated to this:

(a==2?some code:some other code);

Shorter, huh?

    Mod Removes Wiki by Doorknob
2 Corrected the name more usual in informal use ('conditional shorthands') to their official name ('ternary operators').
source | link

Use conditional shorthandsternary operators:

if(a == 2){
    some code gets executed...;
     } else {
    some other code gets executed...;
     }

can be abbreviated to this:

(a == 2 ? some code : some other code);

Shorter, huh?

Use conditional shorthands:

if(a == 2){
    some code gets executed...;
     } else {
    some other code gets executed...;
     }

can be abbreviated to this:

(a == 2 ? some code : some other code);

Shorter, huh?

Use ternary operators:

if(a == 2){
    some code gets executed...;
     } else {
    some other code gets executed...;
     }

can be abbreviated to this:

(a == 2 ? some code : some other code);

Shorter, huh?

1
source | link

Use conditional shorthands:

if(a == 2){
    some code gets executed...;
     } else {
    some other code gets executed...;
     }

can be abbreviated to this:

(a == 2 ? some code : some other code);

Shorter, huh?