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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public X-Google-Thread: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: 10db24,4cf070091283b555 X-Google-Attributes: gid10db24,public From: "Tim Behrendsen" Subject: Re: What's the best language to learn? [was Re: Should I learn C or Pascal?] Date: 1996/08/21 Message-ID: <01bb8f12$6dbb5f00$32ee6fce@timhome2>#1/1 X-Deja-AN: 175421402 references: <01bb8c6d$c62d44c0$87ee6fce@timpent.airshields.com> <4vdnod$5i8@news1.mnsinc.com> content-type: text/plain; charset=ISO-8859-1 organization: A-SIS mime-version: 1.0 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: Szu-Wen Huang wrote in article <4vdnod$5i8@news1.mnsinc.com>... > Mark Wooding (mdw@excessus.demon.co.uk) wrote: > [snip] > : char buf[...]; > : char *p; > > : ... > > : while (buf[0]==' ') > : { > : for (p=buf;p[0]=p[1];p++) > : ; > : } > > : 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. > : An inkling of what this would be translated into by any implementation > : would surely avoid horrors like this. > > [snip] > What exactly do I need under the cover? This atrocity was committed by > somebody who doesn't even know C and algorithms. You're not proving > your point (if that indeed is your point) that assembly/architecture is > *required* to understand algorithms at all. To require it you must prove > that there isn't any other way to effectively teach algorithms. The > state of education today can be attributed to many, many factors, not > necessarily abstractions! > > : Anyone who asks `what's wrong with that' will be shot. > > This code works, by the way, as far as I can tell. It's even portable. > I suggest you show us somebody with equivalent experience in general > computing as this individual but started on assembly language and see how > this person fares with the problem. Oh, and give them the same amount > of time. You're missing the point. The point is how can *anyone* commit such a monument to inefficient coding? Yet, someone did. That someone obviously sees four lines of code, and therefore it must be OK. Now, if that someone had an assembly background, and could see how these statements were going to compile, they would instantly feel the horror that a good and moral programmer should feel over this code. -- Tim Behrendsen (tim@airshields.com)