PureBytes Links
Trading Reference Links
|
Jim, Gary,
this is a topic close to my heart also.
In the course of my work I've seen and been forced to use many programming
standards, including the famed "Hungarian notation". The standard that I
have learned to like best, however, simply consists in using variable names
that are self-descriptive, unabridged, and capitalized inside for each word,
like
numberOfTrades,
which avoids underscores. I make exceptions, however, for counters in loops
and iterators, such as
for(i=1; i<100;i++)
etc. These counters I like to name i,j,k etc.
Comments where comments are due. Too many of them can cloud the issues also,
such as
a=b*c; // b is multiplied by c to give a :-)
Best regards,
Michael Suesserott
> -----Ursprüngliche Nachricht-----
> Von: Jim [mailto:jimo@xxxxxxxxxx]
> Gesendet: Thursday, December 13, 2001 20:14
> An: omega-list@xxxxxxxxxx
> Betreff: Re: programming standards ?
>
>
> Gary Fritz <fritz@xxxxxxxx> writes:
> >I **HATE** reading code that's full of meaningless variable names
> >like [Value1, Value2 etc.]...
> >
> >Comments are also CRITICAL for any code over about 10-20 lines,
> >especially if you want anybody else to understand it (or if you want
> >to understand it yourself next month!!). Explain what's going on,
> >why you did such-and-so, etc. Maybe the code you write is totally
> >clear to you at the moment you write it, but it's probably not
> >totally clear to anybody else.
>
> We used to say that certain people produce write-only code.
> Their projects sometimes got up and running quickly, but
> always seemed to be plagued by mysterious failures.
>
> John Fogelin, the chief techie at Wind River Systems, once
> remarked that if you could just get all the variable names
> and function names properly defined, you were 90% of the
> way to a working system, and I have to agree. It's worth
> taking that time up front to think things through.
>
> Back when peer code reviews were just coming into fashion in
> the software industry, I asked a lecturer what advice he'd give
> to an individual programmer working without a peer group. He
> said his technique was to set his code aside, for as long as
> he could afford, then pick it back up and review it himself.
> I guarantee that all those comments and well-thought-out names
> will pay for themselves many times over in your review.
>
> Jim
>
|