Deutsch English Français Italiano |
<2028019001.749690291.329651.peter_flass-yahoo.com@news.eternal-september.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!feeds.phibee-telecom.net!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Peter Flass <peter_flass@yahoo.com> Newsgroups: alt.folklore.computers,comp.os.linux.misc Subject: Re: TeX and Pascal [was Re: The joy of FORTRAN] Date: Thu, 3 Oct 2024 16:34:15 -0700 Organization: A noiseless patient Spider Lines: 48 Message-ID: <2028019001.749690291.329651.peter_flass-yahoo.com@news.eternal-september.org> References: <pan$96411$d204da43$cc34bb91$1fe98651@linux.rocks> <5mqdnZuGq4lgwm_7nZ2dnZfqnPSdnZ2d@earthlink.com> <vcub5c$36h63$1@dont-email.me> <1r0e6u9.1tubjrt1kapeluN%snipeco.2@gmail.com> <vcuib9$37rge$5@dont-email.me> <vcvuhh$3hroa$2@dont-email.me> <llhieuF8ej2U2@mid.individual.net> <20240925083451.00003205@gmail.com> <Pascal-20240925164718@ram.dialup.fu-berlin.de> <mdd4j63pmo1.fsf_-_@panix5.panix.com> <oJ-cnQSrLZDYdGX7nZ2dnZfqnPWdnZ2d@earthlink.com> <vdatb6$1l4ch$8@dont-email.me> <vdauah$1lq1u$1@dont-email.me> <lltt6uF4fseU4@mid.individual.net> <vdcn1q$1tmdr$5@dont-email.me> <vddqoe$264fi$2@dont-email.me> <vdf4le$2cn51$6@dont-email.me> <vdh2l1$2p7e2$1@dont-email.me> <vdh3ku$2path$1@dont-email.me> <vdhqnf$2t1fi$4@dont-email.me> <e6tLO.276711$FzW1.154698@fx14.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 04 Oct 2024 01:34:16 +0200 (CEST) Injection-Info: dont-email.me; posting-host="e6776f1b3738bbe19c96a9e575767c31"; logging-data="4126146"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19c4QyF5mT0d0u77x96mvDu" User-Agent: NewsTap/5.3.1 (iPad) Cancel-Lock: sha1:5jSeJzDou42J7kmZ9uFRKOM1/BU= sha1:FSsye/6s4BXcAH8caOGOqUyujrM= Bytes: 3109 Louis Krupp <lkrupp@invalid.pssw.com.invalid> wrote: > On 10/1/2024 3:48 PM, Lawrence D'Oliveiro wrote: >> On Tue, 1 Oct 2024 16:14:37 +0100, The Natural Philosopher wrote: >> >>> And knowing that >>> p=(x>y?3:2); >> I would have done it without the parentheses. There’s too much parenthesis >> clutter around as it is. > > Add some spaces, and you've got something downright readable: > > p = x > y ? 3 : 2; > > Maybe add parentheses around the comparison, especially if it's long or > complex, which this isn't: > > p = (x > y) ? 3 : 2; > > It's idiomatic C. It's everywhere. Perl and Python have something > similar. So does Unisys ALGOL, not that anyone cares: > > P := IF X > Y THEN 3 ELSE 2; > > If you want to see gratuitous cleverness for the sake of cleverness, > there's this: > > p = (x > y) + 2; > > Please don't do that. Would you write: > > P := REAL((X > Y) AND TRUE) + 2; > > if you were doing this in ALGOL? > > I didn't think so. > > Louis > > > > I like the Unisys version. At the cost of a couple of characters it’s readable. The C version is not straightforward for those of us for whom C is a second or third language. -- Pete