httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Striker" <stri...@apache.org>
Subject RE: Minor(?) style questions
Date Tue, 12 Mar 2002 10:03:06 GMT
> From: root@localhost.localdomain [mailto:root@localhost.localdomain]On Behalf Of Eli Marmor
> Sent: 12 March 2002 12:39

> Sander Striker wrote:
>> 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"

Uhuh, true.  If you are going to use the statement inside an expression.
If you are not, and it is just a one-liner, as above, the meaning is the
same.
 
> 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.

I am not going to be amused if I see something like your example being
used anywhere ;)

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

You are missing my point.
 
> But again, the whole issue is minor...

Yeah, let's close this thread on that account.


Sander


Mime
View raw message