From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,4c42ac518eba0bbe X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,4c42ac518eba0bbe X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,4c42ac518eba0bbe X-Google-Attributes: gid1014db,public From: fred@genesis.demon.co.uk (Lawrence Kirby) Subject: Re: Coding for Obscurity Date: 1997/11/26 Message-ID: <880552847snz@genesis.demon.co.uk>#1/1 X-Deja-AN: 292870298 References: <01bcfa5d$7aab9920$LocalHost@default> X-Mail2News-User: fred@genesis.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: genesis.demon.co.uk X-Trace: mail2news.demon.co.uk 880557367 2329 fred genesis.demon.co.uk Organization: none Reply-To: fred@genesis.demon.co.uk Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Date: 1997-11-26T00:00:00+00:00 List-Id: In article <01bcfa5d$7aab9920$LocalHost@default> leon.jones@lineone.net "Leon Jones" writes: >Robert S. White wrote in article ><65fr08$vtu$1@flood.weeg.uiowa.edu>... >> In article <3479F8FB.2D7F@mWilden.com>, Mark@mWilden.com says... >> >> >But ?: is not an idiom; it's a part of the language definition. I'll >> >give you the benefit of the doubt and assume that when you think it >> >through, you understand it. >> >> I _understood_ it in 1983. But right now in thinking about >> it, I'll say that it would have been better from a code maintenance >> point of view, that K&R had never thought of it as a convenient >> typing shortcut. IMHO YMMV I suppose it depends on what you are used to. I suspect that people with a functional language background would be right at home with it. >Couldn't agree more. Ternary operators are horrendous and I avoid them at >all costs. I've been programming for years and I still have to study them >closely before I understand exactly what they do. It is just not as >natural a representation as if/else statements. Also it doesn't allow for >indentation which is surely good programming technique in anyone's book?? This is perhaps the problem: people don't format it very well. However your statement that it doesn't allow for indentation is patently false. There are various ways to indent it for long expressions. My preferred method is for example: (control expression 1) ? (control expression 2) ? value expression 1 : value expression 2 : value expression 3 -- ----------------------------------------- Lawrence Kirby | fred@genesis.demon.co.uk Wilts, England | 70734.126@compuserve.com -----------------------------------------