C versus C++

Should I concentrate on one?

Page 1 of 1

9 Replies - 996 Views - Last Post: 29 July 2008 - 10:59 AM Rate Topic: -----

#1 Dogmasur  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 26-July 08

C versus C++

Post icon  Posted 27 July 2008 - 10:13 AM

I am just starting to learn to program in C on my own. How different is C from C++? Should I just concentrate on C for now or try to take in tidbits of both? If staying with just C, then when should one begin to delve into another language such as C++?

Thanks for your time.
Is This A Good Question/Topic? 0
  • +

Replies To: C versus C++

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1147
  • View blog
  • Posts: 7,134
  • Joined: 07-September 06

Re: C versus C++

Posted 27 July 2008 - 10:18 AM

If you choose to stay with C you should probably get to the point where you are fairly skilled with programming it before moving on to another language as they (C and C++) have enough differences that some companies require one over the other. I am no expert on this but I think C++ is progbably the way to start, as it is all object oriented (if you want it to be) you can do a lot of things that C would have a harder time with (though they are both capable of doing the exact same things if you are willing to work at it long enough).

That is just my personal prefference but I hope it helps.
Was This Post Helpful? 0
  • +
  • -

#3 jderecho  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 26
  • Joined: 23-July 08

Re: C versus C++

Posted 27 July 2008 - 10:48 AM

If your aim is that this study is a path to a professional career, keep in mind that there is an incredible amount of legacy code out there in C. The companies are slow to adopt a new language when they have invested so much in C. I would still recommend studying C++ because C is a subset of C++. There probably is much more code in C/C++ out there than just about any other language. After learning C++, it is not difficult to learn C.

If the aim of this study is for recreation, I would look into whatever area your recreation will take you (Win32, Windows Console, Windows MFC, UNIX…etc.). If it will be Windows MFC, then go the C++ route. If it is one of the other areas, go with what would seem like more fun to you.
Was This Post Helpful? 0
  • +
  • -

#4 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: C versus C++

Posted 27 July 2008 - 11:44 AM

The way I learned was C and then C++. The current recommendation out there seems to be to learn C++ before C.

Me myself and I, I think it is best to start with C++ and OOP. This will get you up to speed with modern CS faster than going the C route.
Was This Post Helpful? 0
  • +
  • -

#5 Dogmasur  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 26-July 08

Re: C versus C++

Posted 27 July 2008 - 01:29 PM

I have seen that many recommend learning C++ first. I am definitely looking at bringing this to a professional level at some point in time. The college that I am looking at getting into starts out with C though. I didn't know if trying to learn C++ would cause me grief as I begin my college career or if sorting out the differences would be easy enough for me to adjust to.

Thanks for the input.
Was This Post Helpful? 0
  • +
  • -

#6 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 855
  • View blog
  • Posts: 2,338
  • Joined: 20-August 07

Re: C versus C++

Posted 27 July 2008 - 02:49 PM

Neither language is really better nor worse to start out with (Though C++ is designed to be less frustrating for complete beginners, the C language can seem very terse and nitpicky at times).
- the most important thing to do is pick one and stick with it until you reach the point when you feel confident enough in that language, and want to expand your horizon by tackling another language. If your college are going to feed you C programming, then C is a reasonable choice for you, on the basis that it'll aid you in your studies

There are many differences between C and C++, some of them are pretty clear cut and obvious, others are extremely subtle, and these are the ones which are likely to confuse you if you try learning two languages at once.
Was This Post Helpful? 1
  • +
  • -

#7 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5800
  • View blog
  • Posts: 12,635
  • Joined: 16-October 07

Re: C versus C++

Posted 27 July 2008 - 03:46 PM

I believe C++ is more user friendly than C. Syntactically, C is less complex. Both languages have some concepts that students find challenging and that must be very well understood for proficiency.

For a first language, of the two I'd choose C++, only because it's more forgiving. However, if fundamental concepts of programming are understood and student knows some other language, I'd consider C over C++.

The reasoning is that fundamental concepts of C haunt C++. If you understand C well, then the C elements in C++ hold little mystery and are unlikely to burn you. Psychologically, going to C++ to C might feel constraining. From C to C++ seems liberating.

I often find myself vacillating between the two; sometimes the simplicity of C holds appeal, sometimes the classy overloaded goodness of C++. Ultimately, I believe that any competent C++ programmer should be a competent C programmer as well.
Was This Post Helpful? 0
  • +
  • -

#8 Teaser  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 14-July 08

Re: C versus C++

Posted 28 July 2008 - 07:21 AM

If your college starts with C then I would start with C - do they then learn C++ at a later stage? In either case it makes sense to start with C because it will give you a head start. Before I started University/College I learned PHP and SQL, so by the time I started C at University I could just get on with it, unlike a lot of others who were looking for missing semi-colons and unmatched brackets - it definately helped. So by the same token, if you start with C you will gain a big advantage I think.

I would agree that when you feel comfortable with C you should learn C++, though bear in mind there is more to it than just "C with classes". When I went from C to C++ it did take time to grasp the OO concepts, but I'm talking about a matter of a few weeks to be comfortable with objects, classes and inheritance so it's no big deal. Although that will happen no matter which language you start with.
Was This Post Helpful? 0
  • +
  • -

#9 captainhampton  Icon User is offline

  • Jawsome++;
  • member icon

Reputation: 13
  • View blog
  • Posts: 548
  • Joined: 17-October 07

Re: C versus C++

Posted 28 July 2008 - 08:23 AM

I would say to start off with C++, seeing as most schools pertaining to programming will use C++ as a primary language. And even if not, seeing the parallels between the two is quite easy to see.
Was This Post Helpful? 0
  • +
  • -

#10 Hyper_Eye  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 39
  • View blog
  • Posts: 116
  • Joined: 13-September 07

Re: C versus C++

Posted 29 July 2008 - 10:59 AM

Most of my work in my professional life involves C. But I do a lot of work in C++ as well. It is definitely beneficial to learn both. Beginning with C++ is beneficial because it gets you in the OOP mindset right away. If you spend a lot of time programming in C you will have a hard time keeping yourself strictly within the OOP mindset when you move to C++. On the other hand it is beneficial to learn C first because C++ is based on C and really C++ is confined within C whether you see it or not. Sometimes you do see it and this is when it is beneficial to understand fully how C works.

In my experience it is quicker and easier to slap a quick program together in C. When you are going for the super large application C++ will drive you to write cleaner code, that is more structured, and easier to read if you follow the ideas that C++ are based on (though nothing keeps you there and you absolutely can make a big spaghetti-strewn mess in C++.) You can achieve the same thing in C but you have to define your own structure and practices. You can even program in C within an OOP structure if you wanted to.

I worked at a company called Digium for some time working on their open-source PBX software Asterisk. The code is completely C and very well structured. The application is pretty massive with 100's of thousands lines of code but it is well organized. Mark Spencer created Asterisk and owns Digium. He is fairly well known in the Linux programming community (he was the original creator of gaim and he is well known for asterisk of course.) He will go a bout with you on a discussion of C versus C++ in which he believes any experienced programmer would prefer C even if they develop in an OOP way due to some things in C++ he considers silly or over-the-top (and I do agree that there are some things in C++ that are over-the-top) and I guess due to some needless restrictions. That's basically the gist of what came out in that conversation but I don't remember it perfectly. He would go into nitty gritty details. :P

The bottom line is that learning both is completely beneficial. What you do for your own projects is completely a matter of preference. What you do in your professional life will not be up to you the majority of the time.

This post has been edited by Hyper_Eye: 29 July 2008 - 11:02 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1