Jump to content

C or C++?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Hurricane

Hurricane

    Newbie

  • Members
  • PipPip
  • 20 posts
My English isn't perfect, and there are many new words for me, so I hope you'll understand me. :)

I have a big knowladge of Java, and a really poorly knowladge of C and C++, and I want to continue learning C or C++, but I don't know which language to learn.
On the one hand, C is a procedural-programming-language, and I can learn a lot about algorithmics using it, but on the other hand, C++ is a object-oriented-language, and it can make my programming easy.
As far as I know, from my basic C/C++ knowladge, C++ is an expansion of C with an object oriented programming.

With that said, are there any reasons to pick C instead of C++?

Thanks in advance for your help! =D

#2
morefood2001

morefood2001

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,720 posts
I have only dabbled in C, however I know C++ fairly well.

From a standpoint of looking at procedural C++ vs Object Oriented C++, I would always choose the Object Oriented model for most projects now that involve more than a simple cout, or mathematical equation. I have found that OOP makes the code much more readable and editable.

Reasons for choosing a procedural language would be mainly for speed and smaller scale programs. Also to some people, the procedural code will make a lot more sense. In some cases, procedural code will accomplish the same task with less lines of code though (although it may be much harder to read).

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Going from Java to C will involve a major paradigm shift in how you approach programming. Going from Java to C++ will not involve that shift (as much). To effectively use C++, however, you will have to learn additional concepts. Your methods in Java will have already taught you most of what you need to know about procedural programming.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#4
morefood2001

morefood2001

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,720 posts

WingedPanther said:

Going from Java to C will involve a major paradigm shift in how you approach programming. Going from Java to C++ will not involve that shift (as much). To effectively use C++, however, you will have to learn additional concepts. Your methods in Java will have already taught you most of what you need to know about procedural programming.

Java as I learned it is entirely Object Oriented, very little procedural. I've found that Object Oriented Programming is much harder to understand and grasp. However once you understand it, I've found that for me, procedural programming became much less useful since OOP made the overall picture look much easier to code.

Therefore, I'd say that you want to learn procedural if you want to start easy and work your way up, and Object Oriented if you want to start at a difficult level and work your way down.

C++ can be either procedural or Object Oriented, however its poor garbage collection, and needed understanding of variables might confuse you to where starting with Java might be better.

I hope I explained that tongue twisting thought somewhat better lol

#5
sohel003

sohel003

    Newbie

  • Members
  • Pip
  • 3 posts
really poorly knowladge of C and C++, and I want to continue learning C or C++, but I don't know which language to learn.
On the one hand, C is a procedural-programming-language, and I can learn a lot about algorithmics using it, but on the other hand, C++ is a object-oriented-language, and it can make my programming easy.