Hello Marek!

On Tue, Mar 15, 2011 at 9:49 PM, Marek Peca <[email protected]> wrote:
>> (..) I am really after keeping code clean and standarized, but nowadays
>> monitors are wide enough to display more than 80 characters,
>
> true for monitors, not true for (at least mine) human vision physiology.
> Please, keep the linewidth less than 80 chars.

Please consider this example that could have been written in 9 lines
instead of 24...

    /* Set Data Bits High Byte
       disable output drivers */
    urj_tap_cable_cx_cmd_push (cmd_root, SET_BITS_HIGH);
    urj_tap_cable_cx_cmd_push (cmd_root,
                               BITMASK_ARMUSBOCD_nTRST
                               | BITMASK_ARMUSBOCD_nTRST_nOE |
                               BITMASK_ARMUSBOCD_nTSRST);
    urj_tap_cable_cx_cmd_push (cmd_root,
                               BITMASK_ARMUSBOCD_nTRST |
                               BITMASK_ARMUSBOCD_nTRST_nOE |
                               BITMASK_ARMUSBOCD_nTSRST |
                               BITMASK_ARMUSBOCD_RED_LED);

    /* Set Data Bits High Byte
       set all to input */
    urj_tap_cable_cx_cmd_push (cmd_root, SET_BITS_HIGH);
    urj_tap_cable_cx_cmd_push (cmd_root,
                               BITMASK_ARMUSBOCD_nTRST
                               | BITMASK_ARMUSBOCD_nTRST_nOE |
                               BITMASK_ARMUSBOCD_nTSRST);
    urj_tap_cable_cx_cmd_push (cmd_root, 0);
    urj_tap_cable_cx_xfer (cmd_root, &imm_cmd, cable,
                           URJ_TAP_CABLE_COMPLETELY);


It would then look (also trailing tabs replaced with spaces):

 /* Set Data Bits High Byte disable output drivers */
 urj_tap_cable_cx_cmd_push (cmd_root, SET_BITS_HIGH);
 urj_tap_cable_cx_cmd_push (cmd_root, BITMASK_ARMUSBOCD_nTRST |
BITMASK_ARMUSBOCD_nTRST_nOE | BITMASK_ARMUSBOCD_nTSRST);
 urj_tap_cable_cx_cmd_push (cmd_root, BITMASK_ARMUSBOCD_nTRST |
BITMASK_ARMUSBOCD_nTRST_nOE | BITMASK_ARMUSBOCD_nTSRST |
BITMASK_ARMUSBOCD_RED_LED);

 /* Set Data Bits High Byte set all to input */
 urj_tap_cable_cx_cmd_push (cmd_root, SET_BITS_HIGH);
 urj_tap_cable_cx_cmd_push (cmd_root, BITMASK_ARMUSBOCD_nTRST |
BITMASK_ARMUSBOCD_nTRST_nOE | BITMASK_ARMUSBOCD_nTSRST);
 urj_tap_cable_cx_cmd_push (cmd_root, 0);
 urj_tap_cable_cx_xfer (cmd_root, &imm_cmd, cable, URJ_TAP_CABLE_COMPLETELY);

(i hope gmail did not wrap the lines)


> Try this and judge readability by yourself. You can perform some
> experiments with 'indent' utility.

This is why I use simply "space" with no voodoo :-) For better
readability I also use something like below, but what about long
strings that wrap on many lines?

param |= bitmask;
param |= bitmask;
function(param);

Wide lines looks better even on my 12' laptop terminal. It also
matters when viewing the content at first time. I agree with you
totally that indent works really "nice" for languages where indent
indeed marks the code section, like in Python :-) :-) :-)

Best regards! :-)
Tomek

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to