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: fc89c,97188312486d4578 X-Google-Attributes: gidfc89c,public X-Google-Thread: 103376,97188312486d4578 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,6154de2e240de72a X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,baaf5f793d03d420 X-Google-Attributes: gid109fba,public From: tim@franck (Tim Hollebeek) Subject: Re: What's the best language to start with? [was: Re: Should I learn C or Pascal?] Date: 1996/08/01 Message-ID: <4tos4v$kfl@cnn.Princeton.EDU>#1/1 X-Deja-AN: 171312589 references: <01bb73e3.1c6a0060$6bf467ce@dave.iceslimited.com> <1996Jul20.124025.122789@kuhub.cc.ukans.edu> <01bb7b06$311fabc0$87ee6fce@timpent.airshields.com> <31FBC584.4188@ivic.qc.ca> <4toc18$4j0@ns3.iamerica.net> organization: Princeton University reply-to: tim@wfn-shop.princeton.edu newsgroups: comp.lang.c,comp.lang.c++,comp.unix.programmer,comp.lang.ada Date: 1996-08-01T00:00:00+00:00 List-Id: AJ Musgrove (amusgrov@varmm.com) wrote: : I also recomend compiled with the "generate assembly" option when a : programmer first starts learning C, so really see what that codes becomes in : assembly. (option is -s on most unix systems). Hmm, isn't it usually -S ? Also, I wouldn't suggest showing this to newbie programmers unless you force them to look at the output from at least two different compilers on two different platforms. Some of the _worst_ C I've seen comes from attempts to write, for example, x86 ML in C. : : C must me learned before C++, that's a point since C++ is a really more : : complex superset. : The first C++ "compilers" really only generated C code, and compiled it. : Most C compilers still really only generate assembly, then assemble it. They : don't do strait to binary/machine format. Actually, if you're going to learn C++, I'd suggest avoiding C, and going back to it later. Many things that are necessary to write C programs, while available in C++, can be completely avoided. String and output handling, for example, differs widely. : : Understanding the machine architecture is one thing, using assembly : : languages is another. There's no real interest in knowing all the : : mnemonics of a peculiar assembly language for a C coder: knowing how : : stacks work or how system calls are performed is enough to make efficient : : C programs. I agree with this sentiment. : In the military, soldiers are taught how to disassemble guns. : Why? There are people who could do that for them. If one FULLY understands the : tools they are using, one can use them better. Period. That particular tool only, though. Too much code is written with a particular compiler in mind, instead of writing clear code that can compiled well for _any_ platform. For example: x *= 16; /* will be compiled well by any decent compiler, probably generating a bitshift operation if available */ x <<= 4; /* Harder to read, and will generate _slower_ code on many architectures which lack a multibit shift operation */ --------------------------------------------------------------------------- Tim Hollebeek | Disclaimer :=> Everything above is a true statement, Electron Psychologist | for sufficiently false values of true. Princeton University | email: tim@wfn-shop.princeton.edu ----------------------| http://wfn-shop.princeton.edu/~tim (NEW! IMPROVED!)