C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 14th, 2002, 07:49 PM
o0OBruceLeeO0o o0OBruceLeeO0o is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Huntington Beach, CA
Posts: 0 o0OBruceLeeO0o User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to o0OBruceLeeO0o
New to Programming (C++ question)

After ready a few posts similar to mine, I have seen that you guys reccomend C before learning C++. I would just like to comfirm that this is the route to go for someone new to programming (aside from html, but I dont think that counts hehe). Just double checking for myself because i remember seeing in a C++ tutorial that C "poisons" your mind for C++.

Also, if C is necissary, whats a good book to start with? Thanks!

Reply With Quote
  #2  
Old October 14th, 2002, 08:42 PM
Analyser's Avatar
Analyser Analyser is offline
*bounce*
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2002
Location: Delft, The Netherlands
Posts: 513 Analyser User rank is Sergeant Major (2000 - 5000 Reputation Level)Analyser User rank is Sergeant Major (2000 - 5000 Reputation Level)Analyser User rank is Sergeant Major (2000 - 5000 Reputation Level)Analyser User rank is Sergeant Major (2000 - 5000 Reputation Level)Analyser User rank is Sergeant Major (2000 - 5000 Reputation Level)Analyser User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 22 h 45 m 12 sec
Reputation Power: 41
Send a message via ICQ to Analyser
Quote:
Just double checking for myself because i remember seeing in a C++ tutorial that C "poisons" your mind for C++.


Personally, I'd say it's the other way around. To a certain degree, C++ is a superset of C, meaning that most C code is also valid C++ code. So syntactically they can appear to be very similar. C++ is the more complicated of the two languages though, as opposed to C which is a fairly "simple", more minimalistic language.

However, since every programming language is based on certain philosophies, ideas and a certain design, each language comes with its own "mind-set", so to speak. To program C effectively, you need to approach both the language and the problems in a certain way.

C is more like a thin layer on top of assembly; it's a rather low-level, strictly procedural language.

C++ on the other hand incorporates object oriented programming, introducing abstract concepts such as classes, objects and templates. Also, C++ does some of its magic at run-time instead of compile-time.

So, given a problem of at least some complexity, an implementation in C would look quite different from a C++ implementation.

My point is that C and C++ are actually two quite distinctive languages, once you've mastered them. And since C is the more minimalistic of the two, I think it'd be more suited as a first programming language than C++. If you insist on learning object oriented programming right away, you might consider Java, which is a very clean language.

Regarding books on C, I recommend the following:

The C Programming Language, by Kernighan and Ritchie, with Ritchie being the "inventor" of the language. This is a classic, and considered the C bible by many. Some find it hard to read, or have trouble with the exercises, but it is very thorough. It's commonly refered to as K&R.

Expert C Programming, by Peter van der Linden. Once you feel comfortable using C, and think you know pretty much everything, give this a read. Not only are pointers and arrays explained in excruciating detail, but the author also has a great sense of humour

C: A Reference Manual, by Harbison & Steele. This is the C reference manual for nitpickers. It even covers trigraphs (of all things) in-depth. Covers the standards, and, unlike most reference manuals, has exercises.

I can't recommend any other introductory books, since I haven't read any of them except for K&R. But I'm sure someone else knows one or two
__________________
"A poor programmer is he who blames his tools."
http://analyser.oli.tudelft.nl/

Reply With Quote
  #3  
Old October 14th, 2002, 08:50 PM
o0OBruceLeeO0o o0OBruceLeeO0o is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Huntington Beach, CA
Posts: 0 o0OBruceLeeO0o User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to o0OBruceLeeO0o
Ok, thanks so much for the reply!!! I will be going with the K&R book. At URL it got an average rating of 4.5/5 and its only 40$, which from what I have seen is a decent price . And a follow up question: would Visual C++ 6.0 be good to compile C programs? Thanks again!

Reply With Quote
  #4  
Old October 15th, 2002, 05:14 AM
rendy's Avatar
rendy rendy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: London
Posts: 349 rendy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 19 m 21 sec
Reputation Power: 11
IMHO I wouldn't bother learning C before C++ unless you wanted to start working with legacy C systems?

Go straight ahead with C++, get a book, "The C++ programming language - Bjarne Stroustrup" the guy who wrote C++ its an invaluable resource.. Also get any books you can (esp Effective C++, and More effective C++) by Scott Meyers, who is a superb C++ writer!

Oh and yes VC++ 6.0 will be fine to compile C programs, but a little bit of overkill to be honest
__________________
Invoice Software

here

click here

Reply With Quote
  #5  
Old October 15th, 2002, 09:24 AM
realnowhereman realnowhereman is offline
Not there when you need me
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2001
Location: Berlin, Germany
Posts: 1,430 realnowhereman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 46 sec
Reputation Power: 13
Quote:
Originally posted by o0OBruceLeeO0o
would Visual C++ 6.0 be good to compile C programs?

It's rather too much. You can of course use it, but you won't need most of the features. And it's (too) expensive.

My suggestion is, if you're a Wintendo type, that you get Cygwin, read the DOS-Win-to-Linux-HOWTO (chapters 2, 3, 10, 11.4, 11.6, 11.7, 11.8, 11.9, the rest is worth reading too but less important since you haven't actually started using Linux) and use Cygwin (especially, gcc) for your C exercises. If you use Linux, BSD or UNIX anyway, go on using it since you've probably already got a C compiler there. (If you're using Wintendo but are willing to invest a bit more time and HD space, get a Linux distro.)

The advantage of programming in a UNIX-like environment is that a) it's cheap, b) you get a better feeling for the language (C was used on UNIX before Wintendo was born), c) the K&R book is (afaik - I've never read it) rather UNIX-centric (although everything will also work in VC++, since it's ANSI C) and d) Wintendo is for lusers

Reply With Quote
  #6  
Old October 15th, 2002, 01:26 PM
o0OBruceLeeO0o o0OBruceLeeO0o is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Huntington Beach, CA
Posts: 0 o0OBruceLeeO0o User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to o0OBruceLeeO0o
Well I got visual studio 6 for 40$ on student discount, so I think ill use it. That way when I start doing C++ I will be more familiar with the IDE. Thanks so much for the replies!

Reply With Quote
  #7  
Old October 16th, 2002, 07:05 AM
StealthElephant's Avatar
StealthElephant StealthElephant is offline
Shes dancing (obviously)
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2002
Location: the far side
Posts: 527 StealthElephant User rank is Corporal (100 - 500 Reputation Level)StealthElephant User rank is Corporal (100 - 500 Reputation Level)StealthElephant User rank is Corporal (100 - 500 Reputation Level)StealthElephant User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 38 m 39 sec
Reputation Power: 12
it can be annoying to see c code used in a c++ program instead of the C++ counter parts, learn c++ first to avoid this, then stepping to c is easy if u good at c++
__________________

microsofts butterfly is their way off telling u their systems have a **** load of buggs
Advocating Linux Guide
Lesbian Linux
Great & Practical Computer Books

like the links?

Reply With Quote
  #8  
Old October 16th, 2002, 09:10 AM
pajo pajo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 0 pajo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Why buying a book when you can get one for free. An excelent C++ book (actually two books: Volume 1 is basics, Volume 2 is advanced) from Bruce Eckel, Thinking in C++, can be downloaded from here: URL

By the way, I agree that learning C before C++ is a good idea (it is like learning to walk before you lear to run), and I fully recommend K&R book.

Reply With Quote
  #9  
Old October 16th, 2002, 02:29 PM
o0OBruceLeeO0o o0OBruceLeeO0o is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Huntington Beach, CA
Posts: 0 o0OBruceLeeO0o User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to o0OBruceLeeO0o
I ordered the K & R book. Thanks for the replies everyone. Correct me if I am wrong, but now that I think about it, I believe it was the Bruce Eckel, "Thinking in C++" that said C ruins your mind for C++.

Reply With Quote
  #10  
Old October 16th, 2002, 02:42 PM
Rdesign Rdesign is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Redding
Posts: 49 Rdesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 11
But, my mind is already ruined.

How could having experience is such a similar language ruin your brain for C++? It seems to be all about object orientation in C++, where C is strictly procedureal. Please correct me if I'm wrong, but aren't they about 90% the same?

Reply With Quote
  #11  
Old October 16th, 2002, 02:45 PM
o0OBruceLeeO0o o0OBruceLeeO0o is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Huntington Beach, CA
Posts: 0 o0OBruceLeeO0o User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to o0OBruceLeeO0o
Re: But, my mind is already ruined.

Quote:
Originally posted by Rdesign
How could having experience is such a similar language ruin your brain for C++? It seems to be all about object orientation in C++, where C is strictly procedureal. Please correct me if I'm wrong, but aren't they about 90% the same?


dont ask me . Ask Bruce Eckel, or read the first few chapters of his eBook lol.

Reply With Quote
  #12  
Old October 17th, 2002, 02:58 AM
pajo pajo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 0 pajo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Every approach is a meter of taste and personal preferences. C is indeed procedural language, very close to the machine architecture, whose base has not changed in the last 40 years. By learning it one gets closer to the machine, which I found positive (it is like a car driver that is also a bit mechaniker). While C++ is also "quite low" it forces you to concentrate on more complex things (overloading, inheritance, virtual functions, etc.) One notable example is pointers. In C++ they could be substituted (in many cases) with references, in C they are one of the strongest expressions and keep you thinking on the memory level.

My advice would therefore be the following. If you have enough time and want a kind of academic approach, learn C before C++. If, however, you want to be productive as fast as possible (though this could be dangerous) go straight to C++.

Reply With Quote
  #13  
Old November 7th, 2002, 01:28 PM
isvara isvara is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: UK
Posts: 2 isvara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lots of conflicting replies :-) Just to add to them, I'd suggest not learning C before C++. In my experience it takes a long time to get out of the 'bad habits' (in C++; perfectly acceptible in C).

As for book recommendations, I'd suggest "Accelerated C++" by Koenig and Moo.

Reply With Quote
  #14  
Old November 13th, 2002, 06:55 AM
pschmerg pschmerg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Blacksburg VA/Philly PA
Posts: 38 pschmerg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 29 m
Reputation Power: 11
Send a message via AIM to pschmerg
i'd say learn c first. your knowledge in c will be valuable in learning c++. c is still very commonly used in OS development.

Reply With Quote
  #15  
Old November 15th, 2002, 02:15 AM
vlachmore vlachmore is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 0 vlachmore User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
would Visual C++ 6.0 be good to compile C programs? Thanks again!


I am using VC++ for 2-3 years working with C++. When I had to compile programs that my students had to write in C the result was broken nerves. C++ is in many ways a superset of C but is stricter. And this makes the difference in projects that C should be used (writing a driver). Therefore, if somebody is serious about learning anu using C should use a C compiler. KDevelop for example has different project settings for C projects. I would sugges cygwin along with an editor you like. Well that's my two pennies.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > New to Programming (C++ question)

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap