PreviousUpNext

12.8  Line stuff up

Neatness counts!

Where practical, line stuff up to take advantage of early stages in the visual processing pipeline.

For example, reformatting

            my (f, e) = if (f < 1.0) scale_up (f, e);
                     elif (f >= 10.0) scale_dn (f, e);
                       else (f, e); fi;

as

            my (f, e)
                =
                if    (f <   1.0)   scale_up (f, e);
                elif  (f >= 10.0)   scale_dn (f, e);
                                             (f, e);
                fi;

makes the code easier to read.

Similarly, it is much harder to spot the misspelling in

fun is_const (VARIABLE_IN_EXPRESSION _) => FALSE;
  is_const ( CONSTRUCTOR_EXPRESSION _)=> TRUE;
 is_const ( INT_CONSTANT_IN_EXPRESSION  _)=>  TRUE;
   is_const ( UNT_CONSTANT_IN_EXPRESION _) =>TRUE;
  is_const (FLOAT_CONSTANT_IN_EXPRESSION  _) => TRUE;
   is_const (STRING_CONSTANT_IN_EXPRESSION  _)=>  TRUE;
  is_const ( CHAR_CONSTANT_IN_EXPRESSION _) => TRUE;
  is_const ( FN_EXPRESSION _) =>  TRUE;
 end;

than in

fun is_const (       VARIABLE_IN_EXPRESSION     _) =>  FALSE;
    is_const (       CONSTRUCTOR_EXPRESSION     _) =>  TRUE;
    is_const (   INT_CONSTANT_IN_EXPRESSION     _) =>  TRUE;
    is_const (   UNT_CONSTANT_IN_EXPRESION      _) =>  TRUE;
    is_const ( FLOAT_CONSTANT_IN_EXPRESSION     _) =>  TRUE;
    is_const (STRING_CONSTANT_IN_EXPRESSION     _) =>  TRUE;
    is_const (  CHAR_CONSTANT_IN_EXPRESSION     _) =>  TRUE;
    is_const (                FN_EXPRESSION     _) =>  TRUE;
end;

If you are nice to your pre-cortical visual pathway it will reward you.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext