From: David Combs on
Subj: these days, who & what-for use c vs c++?

I've got this young guy (24 yrs old) visiting,
who's been administering Solaris for a couple
of years.

One thing he has not had time to learn (didn't
go to college) is a programming language, and
was asking me for advice on where to start out.

I felt that he should start out with C, because
with it you were quickly (a) getting a feeling
of what happens low-level, via pointers, call-stacks,
functions calling other functions, the concepts of
catch and throw, grabbing and releasing memory (malloc),
string-scanning, array layout, and so on --

all without a truly huge amount of syntax to master,
plus classes and their syntax, new and destructors
and who gets responsibility for what -- which would
be the case with, say, C++.


He replies that "no one uses C any more", and that if most
jobs being advertised require C++ (not specifying "C" itself),
then shouldn't he just start out learning C++ straight
away, with no delay due to first learning and using
and debugging a smaller, simpler language.



What would be YOUR advice, and why?

And what about his "no one uses C any more"?


(The idea is that tomorrow I can show him this question
I'm now posting, as well as the answers and opinions
from you, well, experts.)


THANK'S MUCH!

David


From: chuckers on
On Aug 5, 2:58 pm, dkco...(a)panix.com (David Combs) wrote:
> Subj: these days, who & what-for use c vs c++?
>
> I've got this young guy (24 yrs old) visiting,
> who's been administering Solaris for a couple
> of years.
>
> One thing he has not had time to learn (didn't
> go to college) is a programming language, and
> was asking me for advice on where to start out.
>
> I felt that he should start out with C, because
> with it you were quickly (a) getting a feeling
> of what happens low-level, via pointers, call-stacks,
> functions calling other functions, the concepts of
> catch and throw, grabbing and releasing memory (malloc),
> string-scanning, array layout, and so on --
>
> all without a truly huge amount of syntax to master,
> plus classes and their syntax, new and destructors
> and who gets responsibility for what -- which would
> be the case with, say, C++.
>
> He replies that "no one uses C any more", and that if most
> jobs being advertised require C++ (not specifying "C" itself),
> then shouldn't he just start out learning C++ straight
> away, with no delay due to first learning and using
> and debugging a smaller, simpler language.
>
> What would be YOUR advice, and why?
>
> And what about his "no one uses C any more"?

Answering in reverse:

C is still used extensively in all sorts of places. You can't really
have C++ without
having C.

And, because of that, it would be better to get your head wrapped
around the basics of C
first and THEN try to wrap your head around C++ and OOP which is a bit
hairier.

You probably can't really learn C++ without learning C at the same
time but things like
pointers etc. are a bit easier to deal with if you don't have to fight
learning about
objects and classes at the same time. Pointers are what will really
screw up your programmes
with really hard to track down bugs.
From: Ian Collins on
On 08/ 5/10 06:13 PM, chuckers wrote:
>
> You probably can't really learn C++ without learning C at the same
> time but things like
> pointers etc. are a bit easier to deal with if you don't have to fight
> learning about
> objects and classes at the same time. Pointers are what will really
> screw up your programmes
> with really hard to track down bugs.

Which leads to one strong reason for using C++ - you can hide and manage
those pointers in such a way the programmer doesn't have to worry about
them!

--
Ian Collins
From: Ian Collins on
On 08/ 5/10 05:58 PM, David Combs wrote:
> Subj: these days, who& what-for use c vs c++?
>
> I've got this young guy (24 yrs old) visiting,
> who's been administering Solaris for a couple
> of years.
>
> One thing he has not had time to learn (didn't
> go to college) is a programming language, and
> was asking me for advice on where to start out.
>
> I felt that he should start out with C, because
> with it you were quickly (a) getting a feeling
> of what happens low-level, via pointers, call-stacks,
> functions calling other functions, the concepts of
> catch and throw, grabbing and releasing memory (malloc),
> string-scanning, array layout, and so on --

As an he is an admin, I would suggest Python as a first language. The
OpenSolaris IPS packaging code is all written in Python.

> He replies that "no one uses C any more", and that if most
> jobs being advertised require C++ (not specifying "C" itself),
> then shouldn't he just start out learning C++ straight
> away, with no delay due to first learning and using
> and debugging a smaller, simpler language.

C is still king in kernels, drives and the majority of embedded systems.

--
Ian Collins
From: Gary R. Schmidt on
Ian Collins wrote:
[SNIP]
> C is still king in kernels, drives and the majority of embedded systems.
>
And C is at least 10^17 times more portable than C++.

Cheers,
Gary B-)