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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public X-Google-Thread: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: 10db24,4cf070091283b555 X-Google-Attributes: gid10db24,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public From: djohnson@tartarus.ucsd.edu (Darin Johnson) Subject: Re: What's the best language to learn? [was Re: Should I learn C or Pascal?] Date: 1996/08/21 Message-ID: #1/1 X-Deja-AN: 175666012 sender: djohnson@tartarus.ucsd.edu references: <4u7hi6$s2b@nntp.seflin.lib.fl.us> <4uo74j$95p@ns.broadvision.com> organization: UCSD Computer Science and Engineering Department newsgroups: comp.edu,comp.lang.ada,comp.lang.c,comp.lang.c++,comp.unix.programmer Date: 1996-08-21T00:00:00+00:00 List-Id: mdw@excessus.demon.co.uk (Mark Wooding) writes: > while (buf[strlen(buf)-1]==' ') > buf[strlen(buf)-1]=0 > > I can't believe that anyone with an understanding of what goes on `under > the covers' would possibly write anything like this without feeling ill. Actually, when I first started my current job, most of the code looked a bit like that. The author is an old MVS programmer and likes C (when compared to assembler which is what MVS is usually programmed in), but hasn't used C that long. Here's a real sample (indentation preserved). static char ablank[] = " "; while(0 !=( strncmp(buffp,ablank,1)) & 0 !=( strncmp(buffp,"\n",1))) { strncpy(destp,buffp,1); buffp +=1; destp +=1; } strncpy(destp,"\0",1); -- Darin Johnson djohnson@ucsd.edu O- "Look here. There's a crop circle in my ficus!" -- The Tick