Article View: rec.games.programmer
Article #2047Re: Should I learn C or C++ first?
From: Duncan Anker
Date: Wed, 06 Sep 1995 08:19
Date: Wed, 06 Sep 1995 08:19
49 lines
2466 bytes
2466 bytes
Marauder (marauder@encomix.es) wrote:
: In article <41nga5$qau@druid.borland.com>,
: pete@borland.com (Pete Becker) wrote:
: > "So much clearer"? Really? Which of these two is easier to read?
: >
: > typedef void (*sigfunc)(int);
: > sigfunc signal(int sig, sigfunc func);
: >
: > or
: >
: > void (*signal(int sig, void (*func)(int)))(int);
: >
: > I am not an idiot, and I will always use the first form rather than the
: > second. Good code is written clearly, not cleverly.
: Yep. But keeping on mind some limits. I get really sick when I read in C
: #define BEGIN {
: #define END }
Good for typing enthusiasts. :-)
: main()
: BEGIN
: ..
: END
: And replying to the subject, imho you shouldn't learn C++ before C.
: I choose between C, C++ and Asm for my projects. See? C and C++. Some
: things are better to write in C and others in C++.
To chuck in my <checks current inflation values and exchange rates> $5 worth,
our university used to teach Modula-2 in the first semester and C in the
second semester. Now they teach C++ in first semester, as of this year, and
I have seen numerous students who understood C++ getting totally thrown.
For example, I was asked why some code didn't work. It was because the
variable was being declared in the middle of the function body, not at the
top. When I pointed this out, I was reminded that it's legal to do this in C++.
I think it's far easier to learn C, and pick up the C++ extras later than it
is to try and do it the other way around. Teach people 'cout' and they'll
want to know why they have to use printf 6 months later...
C is also good for really small projects when you don't want code bloat ;-)
--
mailto:danker@hardy.ocs.mq.edu.au http://hardy.ocs.mq.edu.au/~danker/
GCS d-@ s: a-- C++(++++)$ US+ P+ L- E--- W+++ N+++ K--- w--- O? M++$ V--
!PS PE Y PGP-- t@ 5? X R tv+ b+ DI-- D--- G e*>++ h* r* y-
Technical Details
Message-ID:
<42jlin$rfl@sunb.ocs.mq.edu.au>Path:
arc1-ca.pugleaf.net!sunb.ocs.mq.edu.au!dankerReferences:
<40o2ee$aqp@deyke3.fc.hp.com> <DDIE24.Hqw@info.uucp> <QY4QwcM6hzrf083yn@encomix.es>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sunb.ocs.mq.edu.au!danker From: danker@hardy.ocs.mq.edu.au (Duncan Anker) Newsgroups: rec.games.programmer,comp.lang.c++ Subject: Re: Should I learn C or C++ first? Followup-To: rec.games.programmer,comp.lang.c++ Date: 6 Sep 1995 08:19:35 GMT Organization: Macquarie University Message-ID: <42jlin$rfl@sunb.ocs.mq.edu.au> References: <40o2ee$aqp@deyke3.fc.hp.com> <DDIE24.Hqw@info.uucp> <QY4QwcM6hzrf083yn@encomix.es> NNTP-Posting-Host: hardy.ocs.mq.edu.au X-Newsreader: TIN [version 1.2 PL2]