Real estate of a page

A page is a unit of our thinking, what we can glance at a time, and what we can grasp at a time. Unless you are a mutant genious, you can not think more than that at a once.

So for programming, we should write as much as possible in a page, so that one chunk of work do not continue to the next page. The real estate on a page is precious.
You should not waste.

– Do not use unnecessary long name.
– Use shorter, cleaner, regular name.
– Write a simple thing in a simple way.

Here is an example.
bad:

    if ( GCX_CMLIB_check_frame_status( pGCXFrame, frame_num )
         == GCX_CMLIB_NORERROR )
    {
        frame_count++;
    }

good:

    if ( frameStatus( pGCXFrame, frame_num ) ) {
        frame_count++;
    }

better:

    if ( frameStatus(pFrame, iFrame) ) nFrame++;
Advertisements