Re: [Hampshire] Code style

Top Page
Author: Hugo Mills
Date:  
To: lug, Hampshire LUG Discussion List
Subject: Re: [Hampshire] Code style

Reply to this message
gpg: failed to create temporary file '/var/lib/lurker/.#lk0x573cc100.hantslug.org.uk.11823': Permission denied
gpg: keyblock resource '/var/lib/lurker/pubring.gpg': Permission denied
gpg: Signature made Mon Jun 8 15:16:54 2009 BST
gpg: using DSA key 20ACB3BE515C238D
gpg: Can't check signature: No public key
On Mon, Jun 08, 2009 at 03:09:49PM +0100, Vic wrote:
>
> > I'm not a fan of the whole concept. I've rarely met a use
> > of the ternary operator, in any language, that made code easier to
> > read.)
>
> They can be very useful :
>
> ArrayStart = StartsWithZero ? 0 : 1 ;
>
> Or even :
>
> #define min(a, b) ((a<b) ? a : b )


I'll live with this use. Concise, readable (once), and above all
hidden from view at the point of use.

> But, as with so many things, ternary operators are easily abused.
>
> The solution, IMHO, is to educate your programmers. Sadly, most people
> seem to want to alter languages instead :-(


Indeed.

Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
      --- Great oxymorons of the world, no. 7: The Simple Truth ---