And as a side-note most compilers worth using will generate the same machine 
instructions when you optimize, so there's no benefit in the "cute" versions.  
The more long-winded "readable" version is much more valuable in the long 
run... IMO

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: January-16-12 10:54 AM
To: U2 Users List
Subject: Re: [U2] Brilliant? or not?

This is one of the reasons why I continue to x=x+1 instead of x++

Not all languages support the ++, but they all support x=x+1

George

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Tony Gravagno
Sent: Monday, January 16, 2012 1:50 PM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] Brilliant? or not?

> From: Charles_Shaffer
> Aside from it not being readable, compacting C code like that can
> reduce portability.  Different compilers may evaluate complex,
> compacted code differently.

Same thing has actually happened with BASIC code that's ported from one 
platform to another.

Rule of thumb: Don't get cute. Spell out the code so that any dumb compiler or 
programmer can read it.

On-topic: that makes my response to this thread, "not".

One of our colleagues from the mid 80's wrote code that was so clean I liked to 
say we could eat off of it.  I think he still reads this forum: So to Mark 
Vander Veen, here we are over 20 years later and I Still appreciate your code.  
Now THAT is Brilliant.

T

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to