Sander Striker wrote:

> >>> 1) Can we decide on a standard style when it comes to using
> >>>    ++ or --?
> >>>
> >>>    Example:
> >>>
> >>>    lines++;
> >>>
> >>>    vs.
> >>>
> >>>    ++lines;
> >>
> >> I prefer the latter. The first thing your eye sees is the increment, then
> >> the variable. The *operation* is first, which is the most important.
> >
> > I'm very bad in styling, but I absolutely agree.
> 
> Consider:
> 
>  lines += 1;
> 
> Which is the same as:
> 
>  lines++;
> 
> Personally I am slowed down when I see this:
> 
>  ++lines;
> 
> Because I am used to seeing the op _after_ the variable.

"lines++" is NOT the replacement of "lines += 1", but of "(lines+=1)-1"

Only "++lines" is the replacement of "lines += 1".

For example, if you have to increment "lines" and after that insert 2
times of it into result, and you MUST do it in one instruction, then
"result = 2 * (lines += 1)" can't be replaced by "result = 2 * lines++"
but only by "result = 2 * ++lines". It's not styling; It's a totally
different thing.

What you are USED to see, is your own taste, but in this case, even the
meaning is different.

But again, the whole issue is minor...

-- 
Eli Marmor
[EMAIL PROTECTED]
CTO, Founder
Netmask (El-Mar) Internet Technologies Ltd.
__________________________________________________________
Tel.:   +972-9-766-1020          8 Yad-Harutzim St.
Fax.:   +972-9-766-1314          P.O.B. 7004
Mobile: +972-50-23-7338          Kfar-Saba 44641, Israel

Reply via email to