🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rec.games.programmer
Article #1995

Re: Should I learn C or C++ first?

#1995
From: Derek Douville
Date: Fri, 18 Aug 1995 07:46
93 lines
3648 bytes
R Shapiro (rshapiro@bbn.com) wrote:
: In article <40mqib$msc@wormhole.cognos.com>, douvilld@Cognos.COM (Derek
: Douville) wrote:

: >One cannot fully apreciate the advanced organizational features of C++
: >until they've programmed in C.  

: And you can't understand the "advanced" features of C until you've
: manually set bits in hardware with toggle switches, right? Therefore every
: new programmer should start by programming in machine language -- yeah,
: that's a *great* way to teach modern principles of programming...

/* HelloIsAnyoneHome.cc  */

#include <iostream.h>
/* A massive,  bulky header file that you don't need */

class Hello {
	private:
	  char str[80];
	  int num;
	public:
	  Hello() { 
			strcpy(str,"Hello, is anyone home?\n");
			num=10;
		 }
	  void DisplayMe();
}

void Hello::DisplayMe()  {
	cout << str << num << endl;
}

void main() {
   Hello Hi;	// a Hello Object
	Hi.DisplayMe();
}

// End of Program

			That's the C++ object oriented way.


#include <stdio.h>

void main() {
	char str[80];	
	int num;

	strcpy(str, "Hello, is anyone home?\n");
	num=4;
	printf("%s%d\n",str,num);
}


	That's the procedural way.  No big overhead,  compiles nice and
fast.  Does the same thing.  And lo and behold,  the C source is
easier to read than the object oriented,  because it's a quick and
dirty program.  It's not old,  archaic programming methodology,  it's
so widely used now days,  I'd be ashamed to walk into a place and
not know C.  I've met three C++ students that didn't know the implimen-
tation of a linked list.  It was deemed "not really important".  Is
this not a basic fundamental tool,  one used in both C and C++?  
Gee,  I'm glad I learned C,  or all that new concept stuff in C++
might have obscured it for me.

	"Duh,  what does that %s%d\n thing mean?" Well,  that's the
printf's format specifier.  "Well,  it doesn't make sense."  So,  I
suppose you'll have a problem with using scanf() to get an integer
input too?  "Oh,  I saw that once.  scanf("%d",num);"  Yeah,  okay,
see ya later.
  
	I said "apreciate", in the above quote.  I also went on to say that 
this isn't about apreciation,  or history.  Read the rest of the post.  

	Stroustrup didn't pull a rabbit out of his hat and say, "Shit,
honey,  I can't fall asleep.  I've been racking my brains all night
trying to figure out what to call this new language I wrote,  based
heavily on C.  What do you think?" 

	You need to understand what memory addresses are before you use 
pointers.  You need to understand what the destruction of an object
really is.  Why bother caring what is happening in the memory,
really?  Hell,  it's just variables and these things called pointers.
It's about the necessary fundamentals.  It's not like the difference
between DOS and Windows.  C is what C++ was built upon.  That should
say something to you. 



Derek Douville
Technology Support Services
Cognos Help Desk, Ottawa
Technical Details
Message-ID: <411gg3$n9t@wormhole.cognos.com>
Path: arc1-ca.pugleaf.net!wormhole.cognos.com!douvilld
References: <3v6qkj$8ak@news1.best.com> <3v713f$2bd@ixnews6.ix.netcom.com> <3vr8mb$400@deyke3.fc.hp.com> <40m1bc$ffk@news-2.csn.net> <40mqib$msc@wormhole.cognos.com> <rshapiro-1408950937080001@esb.bbn.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!wormhole.cognos.com!douvilld
From: douvilld@Cognos.COM (Derek Douville)
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: 18 Aug 1995 07:46:11 GMT
Organization: Cognos Incorporated, Ottawa CANADA
Message-ID: <411gg3$n9t@wormhole.cognos.com>
References: <3v6qkj$8ak@news1.best.com> <3v713f$2bd@ixnews6.ix.netcom.com> <3vr8mb$400@deyke3.fc.hp.com> <40m1bc$ffk@news-2.csn.net> <40mqib$msc@wormhole.cognos.com> <rshapiro-1408950937080001@esb.bbn.com>
NNTP-Posting-Host: aurora.cognos.com
X-Newsreader: TIN [version 1.2 PL2]