C or C++? What's the difference? What is the best? Need to know C to learn C++?

To learn C ++ need to know C?

The initial doubt of anyone interested in C ++ is always involving the C language:

  • “Do I need to study C before studying C ++?”
  • “My friend said that to learn C ++ you have to master C”
  • “C ++ is an extension of C, so to study C ++ you need to know C”


The online Progressive C++ tutorial will now explain in detail and remedy all these types of doubts.

C ou C++: what's the difference

Do you need to know C to learn C ++?

No, it is not necessary. They are two independent programming languages, you can study and create applications with one or the other.

If your friend said that C ++ is an extension of C, he is right.

If he said he needs to study C before studying C ++, he is wrong and you should be away from him.


What is the difference between C and C ++?

C ++ is an extension of C.

It is the C with the most features and functions. And the main difference is that C ++ is multi-paradigm: you can program in C ++ with either the Structured paradigm (C is only structured) or the Object Oriented paradigm (like the Java language, for example).

The ++ symbol in programming means increment. It represents the fact that what you can do with C, you can do with C ++.
C ++ is the incremented C language. So much so that its creator, Bjarne Stroustrup, named it "C with classes".

If C ++ is an extension of C, then ...

Is C++ better than C language?

There is no better language than the other, there is language better suited to a particular type of problem.

Yes, C ++ has more features, but that's not for free.

Its implementation is more complex, there is more going on underneath. Therefore, C ++ is not as efficient as C, it consumes more memory and processing.

Where do you use C and where do you use C++?

As we said, C is more efficient, it's faster. Programming in C is programming next to 'metal', is having direct access to computer memory. This is called low level programming.
C ++ also achieves this, but C ++ also offers the opportunity to work at a high level.

However, some applications require as much speed and efficiency as possible, so C is used for building Operating Systems (such as Linux and Windows) and even for working with microcontrollers.

C ++ is not for these purposes, but it is for others.

The C problem occurs when applications start to get too big, which makes it difficult to control and maintain code. That's where C ++ comes in.

Because of its Object Orientation, and the fact that it has more features and options (such as Templates), it makes programming much easier and dramatically increases the efficiency of the C ++ programmer.

That is, in the same timeframe, the C ++ programmer can be more efficient than a C programmer doing the same thing, because C ++ has more things at the needle end, ready for programmer use.

An example of using the C ++ language is high performance games.
They are too complex to make, so using C or Assembly is not recommended.
However, they need very high efficiency, so they can't be done in a higher level language like Java or C #.

This is where C ++ comes in: it is at the same time much more efficient than most languages ​​and is more ready to use than low-level languages ​​like C.

That is, C ++ is a balance between high performance low level languages ​​and the efficiency of programming high level languages.

Java, for example, is also object oriented and comes with more features, so ...

Which is better, Java or C++?

Please stop wondering if X or Y is better. It's always the same as asking 'which banana or apple is best?'

Banana is most recommended for making banana vitamin, and apple is most recommended for making apple juice.
There is no better language than the other, but more recommended for a particular purpose.
(Friend's tip: Saying that such a language is better than another is a hacking layman's thing. Respect all languages, professionals, and programs if you want to be respectful in the middle.)

The difference starts with the fact that Java is exclusively Object Oriented.
C ++ can be used to program both structured and object oriented.

The best feature of Java is that it is cross-platform, that is, you program in Java and the application runs on Windows, Linux, Mac, mobile and even on paper (kidding).

This is because Java does not run on the machine itself, but rather on a virtual machine (JVM). And that weighs in, making the Java applications heavier.

C++ is not heavy and is much more efficient than Java.
But it is not cross-platform, as C ++ reaches, in some respects, the lowest levels of programming.
Therefore, running a C ++ application on one machine may not work on another, depending on the system architecture.

If C ++ is an extension of C, then ...

Does C commands run in C ++?

Yes, they run most of the time.

Strictly speaking, C ++ is not an extension of C, as there are a few things you can do in C that you can't do in C ++ (as with void * and char *). But overall, 99.99% of the time, your C codes will be interpreted correctly by C ++.

However, as we said at the beginning, they are two independent languages, one does NOT need the other.
So DO NOT MIX C WITH C ++!
It is a terrible and abominable habit. Either program in C or program in C ++.

Nor does it make much sense to program structurally in C ++, as you would be wasting the extra resources that C ++ offers (related to object orientation).
If it is structured programming, go from C.

How is the C++ market?

Let's be honest, and that implies good news and bad news.

The good thing is that the market is great, there is an extreme shortage of GOOD C ++ professionals and overall they earn much more than most other language programmers.

The bad thing is that it is not an easy language or simple to learn.
Your learning curve is longer than the others, and if you want to go ahead with C ++ you must study hard.

So, are you into learning C ++?
Welcome to the Progressive C ++ Course

No comments:

Post a Comment