In <> CBFalconer <> writes:
>Richard Heathfield wrote:
>> Thomas Stegen CES2000 wrote:
>> > Joona I Palaste wrote:
>> >
>> > I think I would object if someone told me to code like this though:
>> > a=b+c*3;
>> > I think a = b + c * 3; is much better.
>>
>> And I prefer
>>
>> a = c * 3 + b;
>>
>> YMMV.
>
>Definitely MV. I can even find cases where I want different
>emphasis, and would write:
>
> a = 3*c + b;
>or
> dsq = b*b - 4*a*c;
>
>although normally I would not suppress the blanks.
As a beginner, I would not insert any space that was not required by the
language. A habit inherited from FORTRAN programming on punched cards,
where you really wanted to avoid continuation cards. Then, one day I was
bitten by
i=-1;
being parsed as
i =- 1;
by a VAX C compiler (=- was the anachronic form of -=, but some
pre-ANSI compilers still supported it). After that, I always left one
space between operators and operands, just to be on the safe side. This
kind of bugs (the compiler parses the code differently than the human) is
just too difficult to spot, so it pays the "effort" needed to avoid it.
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: