Re: New



Randy Howard wrote:
> niklasb@xxxxxxxxxxxxx wrote
> (in article
> <1132791787.554911.5220@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>):
>
> > As to whether C++ is a reasonable first language, I think that depends
> > in part on how it's taught.
>
> So far, so good.
>
> > C++ can be used and taught as a fairly
> > high-level language, but it is often taught from the bottom up,
> > starting with the lowest-level language features as if it were C
> > (e.g., using pointers and null-terminated strings instead of the
> > standard string class) which tends to overwhelm beginners and
> > over emphasizes the wrong things.
>
> Disagree completely. Ignoring low-level details (which,
> contrary to popular belief, actually do matter) is one of the
> main things wrong with modern CS education today.

We may not disagree as much as all that. I agree that
low-level details matter, and a competent C++ programmer
should be proficient in the "C" part of C++, e.g., null-
terminated strings, raw arrays, pointers, manual memory
management, etc.

All I was trying to say is that the order in which concepts
should be introduced to a new C++ programmer should be
more top-down -- focusing initially in the problem domain,
developing the skill of clearly understanding a problem and
decomposing it into parts (functions, variables, loops, etc.).

In keeping with this top-down approach, one can initially
think of string, vector, list, etc. as "magic" primitive facilities
provided by the language. Fairly soon, though, one should
learn about how these things work at a more nuts-and-bolts
level and how to implement one's own classes.

In contrast, teaching C tends to be more bottom-up, in that
you start close to the machine. That's OK. It's how I learned
programming. But I think C++ lends itself to a more top-
down approach. You may (and probably do) disagree, but
please don't misconstrue me as saying the low-level stuff
doesn't matter.

.



Relevant Pages

  • Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... It's a critique of the "Beautiful" code authored by ... Rob Pike and discussed by Brian Kernighan in a new O'Reilly book. ... programmer, right? ... strings, only for what we call in .Net, sbyte, strings o' bytes. ...
    (comp.programming)
  • Re: A note on personal corruption as a result of using C
    ... Why did you feel the need to handle NULs in strings? ... A bad programmer can recreate Fortran in any language. ... It troubled mathematicians that the square root of minus one seemed to ...
    (comp.programming)
  • Re: User Input issue
    ... now we know that the int data type uses 4 bytes of memory. ... You wrote a moment ago that the programmer does not ... covered strings yet (I'm a college freshman in a Programming I/Novice ...
    (comp.lang.c)
  • Re: PL/I string representations
    ... Mr Nilges is talking through his nose again. ... > machines that use ASCII. ... He liked large strings last year, ... example of a non-promotable programmer who's unfit for any role above ...
    (comp.programming)
  • Re: security enhacement to C runtime library (XXX_s)
    ... In the below link MS announces a security update to the C runtime ... Every buffer overflow error that was made before can still be ... strings in C the way they are used in every other programming ... how can we increase the programmer ...
    (comp.std.c)