should i learn it first ?

Bengt Richter bokr at oz.net
Sun Mar 10 15:29:58 EST 2002


On Sun, 10 Mar 2002 17:13:17 GMT, "G. Sumner Hayes" <sumner-nntp5 at forceovermass.com> wrote:

>In article <a6f0fl$u8n$0 at 216.39.172.122>, Bengt Richter wrote:
>>>
>> I'd say if you don't know C, C++, or Python, then start with Python.
>> Then C++, then C. In that order, you won't have to unlearn patterns
>> of design you absorb solving problems with C.
>
>Ugh, I can see learning Python first but definitely learn C before
>C++.  In that order, you won't have to unlearn patterns of design
>you absorb solving problems with C++.
>
>Seriously, the point of using a low-level language like C or C++ is to get
>next to the hardware, and it should be learned from that level first
>IMO.  Otherwise, stay with a more productive language like Python.
>
I think "low level" is a mis-characterization of C++, even though it obviously
has as much low level capability as C. If you are just going to use the low
level stuff (unless you are talking about assembler within C++), you might as
well use C.

ISTM C++ was designed to let you *build* "levels" with layers of abstraction
through objects and generics. IOW, one group can work at low level
to produce elements that others can use at high level. E.g., instatiating
an mp3-playing object and calling the play method is pretty trivial and high level,
yet the same C++ language can be used to write the guts of almost everything involved.

If you really want to get intimate with the[1] hardware, even C is mostly isolating
you from true carnal knowledge. Get an assembler[2], and choose every instruction and
every data location and access thereto. Disassemble and understand the MBR. Get
Linux or BSD and mess around (on a system you can afford to wipe out ;-)

[1] Of course 'the' will vary with your platform ;-)
[2] OTOH, you'd be surprised what level chunks you can build with macros
    in a good macro assembler.

>> If you start with C, you will get used to a procedural way of looking
>> at problems, and when you get to C++ you will be tempted to see it
>> as just C with extra features. You'll have to dislodge yourself from C
>> habits of thinking in order to "think objects" in C++. Coming from
>
>Conversely, if you learn in the other order you'll find yourself thinking
>of it as a limited version of C++ instead of a different language with
>its own idiom.  The point of C is that it's procedural, small, and close
>to the metal.  Viewing without the corrupting lens of C++ is extremely
>valuable, IMO.
>
I don't know what you mean by "corrupting lens of C++,"
other than a rhetorical counter point ;-)

>FWIW, I know more good programmers who learned C and then C++ than
>vice-versa.
Some of us learned to program before either existed, and couldn't
have the choice of which to learn first without ignoring C for many
years ;-)

But even if you just want to learn C, you can largely use C++ as if
it were C.

Regards,
Bengt Richter




More information about the Python-list mailing list