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: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public X-Google-Thread: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public From: "Alf P. Steinbach" Subject: Re: What's the best language to start with? [was: Re: Should I learn C or Pascal?] Date: 1996/08/03 Message-ID: <3202876B.BC7@online.no>#1/1 X-Deja-AN: 171680425 references: <01bb7da1$323102a0$96ee6fcf@timhome2> <4ttdlg$2pr@news.ida.org> <4ttksk$9lt@solutions.solon.com> content-type: text/plain; charset=us-ascii organization: Telenor Online mime-version: 1.0 newsgroups: comp.lang.c,comp.lang.c++,comp.unix.programmer,comp.lang.ada x-mailer: Mozilla 2.0 (Win95; I) Date: 1996-08-03T00:00:00+00:00 List-Id: Peter Seebach wrote: > > In article <4ttdlg$2pr@news.ida.org>, > David Wheeler wrote: > >That's pretty clueless. However, depending on how well they > >understood their programming language, they might still produce > >a reasonable result. Why? Because, although they may not realize > >that some of these "conversion" operations have no run time impact, > >they may know how to combine the features of their language to > >produce solutions. > > And, if their language doesn't specify a binary representation, they may get > an algorithm right on a weird machine that still uses BCD or decimal > internally. Been to a museum lately? (A) > >Any professional developer must understand several assembly languages, > >and how they work in general. > (B) > I think this is no longer true. Understanding an assembler buys you nothing; > all it tells you is that at least one machine had a certain kind of semantics > inside it. You *don't care*. If you're writing a *solution* to a *problem*, > those are the only things you need to be working with. Pardon me, but this is utter bullshit, both (A) and the response (B). That (A) is untrue is not necessary to discuss. (B) is more subtle, but builds on several assumptions, which can be summed up as a "mathematicians" view of programming: only abstract semantics matter. At least when discussing C, the most popular high level assembler in existence, that argument is clearly not valid. Could be valid in other contexts, though. > If you try to make sure your solution fits your imaginings of the underlying > machine, you constrain it unnaturally. Leave the unnatural constraints for > the rare occasions when your code actually has a detectable performance > problem that can't be quickly traced to a broken algorithm. On the surface, this is good advice. Like Knuth said, "Premature optimization is the root of all evil" (or something on these lines). But that's the surface. The advice as sound advice assumes that the design is *already* guided by a good understanding of the underlying machine. The advice as misguiding advice says something quite different: disregard the machine completely. That's stupid. When you build a house, you need both a good understanding of the plans (abstractions) and the physical materials and other resources. Disregarding or playing down the importance of one or the other leads to failure. > You have attained only the second level of enlightenment. > > The newbie uses a machine, and to the newbie, that is all machines; the > newbie's code runs only on that machine. > > The experienced programmer uses several machines, and has learned how each > behavies. The experienced programmer's code runs on several machines. > > The true programmer uses no machines, and uses the specifications granted by > the language. The true programmer's code runs on any machine. A very nice goal (getting paid for programming without using computers would indeed be ideal). Aber doch, porting isn't quite that easy... :-) - Alf (quite aware of the flame-inviting nature of this thread... :-) )