Jump to content


Photo

Learning C or C++, which first?


  • This topic is locked This topic is locked
14 replies to this topic

#1 CLUEL3SS

CLUEL3SS

    Advanced Member

  • Members
  • PipPipPip
  • 265 posts
  • LocationAkron, Ohio
  • Age:20

Posted 26 June 2012 - 05:20 PM

Should I learn C first or should I just start with C++?

#2 requinix

requinix

    Hopeless Member

  • Moderators
  • 5,989 posts
  • LocationWA

Posted 26 June 2012 - 05:32 PM

I say C first because it forces you to learn things from the ground up, but you don't have to become a professional with it - enough to, say, understand the PHP source code. C++ abstracts out some things that are actually important to know and understand. Things that not nearly enough programmers nowadays know about. Also, get off my lawn.
When in doubt, CHECK YOUR ERROR LOG

#3 CLUEL3SS

CLUEL3SS

    Advanced Member

  • Members
  • PipPipPip
  • 265 posts
  • LocationAkron, Ohio
  • Age:20

Posted 27 June 2012 - 12:41 AM

Get off your lawn? Lol..

Are you able to suggest a good book to start with? I know how to make some simple math programs and such in C++ already.. I have a little bit of knowledge on the basics of C++..

I started programming 3 years ago, Started with PHP, now I can do anything I need done with that.. but if you have any suggestions or could point me in the right direction? Thanks!

#4 requinix

requinix

    Hopeless Member

  • Moderators
  • 5,989 posts
  • LocationWA

Posted 27 June 2012 - 03:09 AM

Not really - I don't learn with books or tutorials. Any series you've tried before and liked? Head First? O'Reilly? Mosey on over to a bookstore, skim through a few books they have, and see what's out there. There's bound to be one or two that will work well for you.
When in doubt, CHECK YOUR ERROR LOG

#5 CLUEL3SS

CLUEL3SS

    Advanced Member

  • Members
  • PipPipPip
  • 265 posts
  • LocationAkron, Ohio
  • Age:20

Posted 27 June 2012 - 12:30 PM

Ahh, I forgot about Headfirst .. I own Headfirst Java - Reading that book was a decent experience.. They make it easier to comprehend.. I'm going to look into Headfirst C++ and C. I've got some of the basics of C++ down. I'm self taught in PHP, I've mastered pretty much every aspect of that language.. I don't know why it has taken me 3 years to even initiate trying to learn C++.. In the beginning it was intimidating I guess.. lol now Its not bad at all

#6 annaharris

annaharris

    Advanced Member

  • Members
  • PipPipPip
  • 56 posts

Posted 05 July 2012 - 07:45 AM

In my opinion, you should learn first of all C and after that C++.


#7 Hall of Famer

Hall of Famer

    OOP Fanboi

  • Members
  • PipPipPip
  • 315 posts
  • LocationIthaca

Posted 07 July 2012 - 03:31 AM

Id say you should just learn C++ without undergoing C training at all. C++ is an object-oriented programming language based on C, the syntax is similar but C++ offers much more advanced features for objects. Moreover, C++ encourages programming in the OO way which can be a problem for hardcore C programmers. If you are so used to coding an application in a pure procedural language, the switch to OOP will be more difficult than it otherwise should be. For absolute beginners procedural programming may be an easier starting point, but it is not really a problem for C++ as it also supports C's syntax. Just make sure you move into OOP right after getting used to basic stuff such as Conditionals, Loops and Functions.

Welcome to the world of OOPHP! In a perfect script, everything is an object. You cannot be perfect, but you can approach as close as can.

zog841.jpg


#8 KevinM1

KevinM1

    Snarkimus Prime

  • Moderators
  • 5,208 posts
  • LocationNew Hampshire, USA

Posted 07 July 2012 - 09:16 AM

@Hall of Famer: again, OOP is not inherently superior than procedural.

@OP: The real question is what do you want to do with the language(s)?  C is generally used for close-to-the-metal programming where speed and efficiency are paramount.  The linux kernel is written in C, for example.  C++ is generally used for mainstream apps.
  • cpd likes this

#9 yoursurrogategod

yoursurrogategod

    Advanced Member

  • Members
  • PipPipPip
  • 179 posts

Posted 01 August 2012 - 01:30 PM

@Hall of Famer: again, OOP is not inherently superior than procedural.

@OP: The real question is what do you want to do with the language(s)?  C is generally used for close-to-the-metal programming where speed and efficiency are paramount.  The linux kernel is written in C, for example.  C++ is generally used for mainstream apps.

I have to disagree with this.  Having worked with both, the line between the two is blurring.  When it comes to performance, C++ is not that far away from C (but this comparison is absurd since it all depends on the assembler that the compiler is generating).  Yes, C is used more for kernel-level code, but its domain is quickly shrinking and becoming less prevalent to just that area.  Even in the operating system sphere, C++ is showing in areas that were previously written in C.  And yes, you can write a kernel in C++ :) .

Also, it depends on your notion of what it means for mainstream apps.

OP, learn C++.  The hardest part about C is the concept of pointers, something that C++ already has.  You will have more room to learn new stuff.  Here are a few tutorials:
- http://www.cplusplus.com/doc/tutorial/
- http://www.cprogramm...m/tutorial.html

Go through those before you bother with buying a book (cheaper).  Honestly, just dive in, all of the other pieces will fall into place.

Lastly, the common mistake newbies make is that they focus on the language and what it -- in theory -- is supposed to do.  If you want to gain a certain mastery (or depending on the direction you would like to head in), make sure to learn some assembler and how the operating system that you're writing against is creating this code.

#10 yoursurrogategod

yoursurrogategod

    Advanced Member

  • Members
  • PipPipPip
  • 179 posts

Posted 01 August 2012 - 01:46 PM

Id say you should just learn C++ without undergoing C training at all. C++ is an object-oriented programming language based on C, the syntax is similar but C++ offers much more advanced features for objects. Moreover, C++ encourages programming in the OO way which can be a problem for hardcore C programmers. If you are so used to coding an application in a pure procedural language, the switch to OOP will be more difficult than it otherwise should be. For absolute beginners procedural programming may be an easier starting point, but it is not really a problem for C++ as it also supports C's syntax. Just make sure you move into OOP right after getting used to basic stuff such as Conditionals, Loops and Functions.

:)

Most people who are so pro-C and anti-C++ tend to be unwilling to learn something new (yes, some of the older developers tend to be like this at times).  Developing code is about grasping new concepts all the time, so unless you're just unwilling to learn something new, this is a non-concern.

#11 XP1

XP1

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 21 October 2012 - 04:46 AM

Ahh, I forgot about Headfirst .. I own Headfirst Java - Reading that book was a decent experience.. They make it easier to comprehend.. I'm going to look into Headfirst C++ and C. I've got some of the basics of C++ down. I'm self taught in PHP, I've mastered pretty much every aspect of that language.. I don't know why it has taken me 3 years to even initiate trying to learn C++.. In the beginning it was intimidating I guess.. lol now Its not bad at all

Head First C was very fun and easy to read. I liked it. Head First C++ doesn't exist. I hope to read Head First C++ when it comes out.

#12 cpd

cpd

    ¬_¬

  • Members
  • PipPipPip
  • 891 posts
  • LocationLondon, UK

Posted 15 January 2013 - 03:38 AM

I couldn't agree more with KevinM1. Which one you choose to learn (first) is completely dependent on your goal. There's no reason why you can't learn C++ first; It inherits everything from C. People seem to think C -> C++ because its a "step up" but in reality its not, its two different languages one being a superset of the other.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."

"One of my most productive days was throwing away 1000 lines of code."

#13 Zane

Zane

    Advanced Member

  • Administrators
  • 3,866 posts
  • LocationMurphy, NC

Posted 19 June 2013 - 10:40 AM

The biggest question is time.  Do you have the time to learn C?  If you're just an unemployed teenager who like programming, I would take the free time that you have an learn C.  In short, it will not hurt you to know C

 

As Kevin mentioned earlier though, it all depends on your needs.  If you're just bored, I would go with C.  if you're looking for a language that you can create a certain application with, learn C++ or C# or Java...

 

Think of it like a vehicle.  C++ would be your ability to add things to the car.  New engine, new stereo system, new alternator, new upholstery , etcetera, etcetera, etcetera...

 

Knowing C would be your ability to tweak of fix these things without even needing a "new" thing.  For instance, say your alternator goes but you just happen to know exactly how to take it apart, change the brushes, make new brushes, whatever.  Battery goes out and you know exactly which chemicals to get to renovate it.  If you get into a fender bender and part of the body of your car is ripped off, leaving a gaping whole, then you would how to weld some old metal to the point that it looks brand new.


btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank

401299.png

#14 requinix

requinix

    Hopeless Member

  • Moderators
  • 5,989 posts
  • LocationWA

Posted 19 June 2013 - 02:07 PM

(cough thread will be one year old next week)
When in doubt, CHECK YOUR ERROR LOG

#15 Zane

Zane

    Advanced Member

  • Administrators
  • 3,866 posts
  • LocationMurphy, NC

Posted 20 June 2013 - 06:56 AM

ah.. damnit, what the fuck?


btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank

401299.png




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com