Re: Programming: Not stressful? Yeah, right...
- From: spinoza1111@xxxxxxxxx
- Date: 31 Oct 2005 01:46:59 -0800
Gerry Quinn wrote:
> In article <Pine.LNX.4.60-041.0510301108330.17201
> @unix40.andrew.cmu.edu>, ajo@xxxxxxxxxxxxxxxxxxxxx says...
> >
> > On Sun, 30 Oct 2005 spinoza1111@xxxxxxxxx wrote:
> > ["Helpful" tips for assembly programming]
> > >
> > > (1) Think in terms of the goal of each set of instructions and hang a
> > > comment to the right of each set (but don't comment every line).
> >
> > Good advice, except that I'd replace "to the right of" with "above."
> > The problem with "to the right" comments is that as soon as you start
> > putting comments and code on the same line, you have to face a tradeoff
> > among having short lines, having readable comments, and having
> > maintainable code formatting. Consider:
> >
> > movl (%ebx,%esi,4),%eax # If array[esi] is less than
> > array[edi]...
> > movl (%ebx,%edi,4),%edx
> > cmpl %eax,%edx
> > jnle @swapped # then swap the array elements and
> > set our "swapped flag" ecx to 1
> > mov %eax,(%ebx,%edi,4)
> > mov %edx,(%ebx,%esi,4)
> > mov $1,%ecx
> > @swapped:
> >
>
> Get a proper monitor, and the above lines will all fit happilly.
Oops. Let's say you have persuaded your boss to buy you a very cool
HDTV style flat panel monitor that is about 3 metres wide and which is
the envy of your office. Let's say you have good eyesight so you set
the font size to 6 twixels or pixels or twerps.
You have a magnificent view of your code, and also of the Sports
Illustrated Swimsuit Issue.
Years later, after global warming and immigration have reduced us all
to equality of condition, a maintenance programmer using a refurbished
Osborne "portable" found in a junkshop, or a 100.00 global laptop made
available to the masses by President of the World Serge Brin (formerly
Google's CEO, elected by popular online acclaim in 2008 after the
attempted Bush coup) tries to view your code...
Seriously, I try to keep my code within 72 characters. This is based on
the width of an IBM punched card, MINUS the sequence number which I
added using an IBM 1401 program years ago, and it is as such of geezer
provenance. But it compromises between the need for readability, the
need occasionally to print the code in landscape or portrait mode, and
the capacities of standard monitors.
>
> - Gerry Quinn
.
- References:
- Programming: Not stressful? Yeah, right...
- From: Dave
- Re: Programming: Not stressful? Yeah, right...
- From: spinoza1111
- Re: Programming: Not stressful? Yeah, right...
- From: Arthur J. O'Dwyer
- Programming: Not stressful? Yeah, right...
- Prev by Date: Re: Programming: Not stressful? Yeah, right...
- Next by Date: Re: Programming: Not stressful? Yeah, right...
- Previous by thread: Re: Programming: Not stressful? Yeah, right...
- Next by thread: Re: Programming: Not stressful? Yeah, right...
- Index(es):
Relevant Pages
|