What makes C++ so powerful?

Started by
147 comments, last by CoffeeMug 17 years, 11 months ago
Well C/C++ is powerfull because it's compiled to native code. In the 80's this was important because pc's werent as powerfull as they are today.

Today pc's are much more powerfull so higher level languages are gaining terrain, because they run at a decent speed and they are much easier to devellop in.

But then again, most of these higher level languages are built using C/C++ :)
Advertisement
well I'll just throw an example out since no one else is.

I've used VB (visual basic) before, and though MFC may be similar, I couldn't figure it out on my own. but with VB I sat down with VB6 and had my own calculator built within a couple of day's. without any extra help, and I made my first game with it. though I would recommend VB for general applications since it is really easy to build windowed apps, and I would suggest it to start game programming, I have found c++ much easier and versitile. and I also find working c++ code easer to read then many of the things VB allows.
Quote:Original post by escudo825
well I'll just throw an example out since no one else is.

I've used VB (visual basic) before, and though MFC may be similar, I couldn't figure it out on my own. but with VB I sat down with VB6 and had my own calculator built within a couple of day's. without any extra help, and I made my first game with it. though I would recommend VB for general applications since it is really easy to build windowed apps, and I would suggest it to start game programming, I have found c++ much easier and versitile. and I also find working c++ code easer to read then many of the things VB allows.


Your point is that one should start with VB, but C++ code is easier to understand? :P I may have understood you wrong.
Zyndrof,

What makes C/C++ so powerful:

Its an "operating system" language. C was originally designed by K&R to implement native code for the UNIX operating system. As a result, it is as "low level" as you can get while still being considered a "high level" language. The ability to inline assembly for speed, the direct acess to memory by using pointers, and the stongly typed nature of the language means that it maps relatively close to the hardware in its functionality - giving it increased performance.

C is also portable. Although not as portable as the more modern languages, C was considered highly portable in its early years. The ability to write the code once, and then compile it on any platform that had a C compiler made it easy to move between windows and unix.

Also, the flexibiltiy and ease of use makes the language suitable for all types of applications. Database, networking, physics, mathematics, games, GUI Interface, even web servers.

Additionally, C++ is object oriented and shares a compatible syntax. The ability to use inheritence, virtual functions, polymorphism, etc..make it relatively dynamic. Additionally, the concepts of encapsulation and data hiding are relatively well done in C++.

Finally, C++ has been used for about 25 years now, meaning that there is a large library of available code for use. This helps to self-perpetuate the language. The more people use it, the more people need to use it in order to be "mainstream."

With all of that being said, C++ is not the "best language" for all things. If you want to write console games, networking application, or kernel level applications that need good performance, C++ is the way to go.

But if you want to write cellular games/applications or web applications, Java has proven to be the dominant and best suited language for these purposes.

As well, C# is gaining ground fast and is already becoming the favorite language for GUI development using the .NET framework. In the end, its just about using the write tool for the job. C++ just happens to be "reasonably" good at all jobs, while not being "excellent" for any...except writing games and operating systems, perhaps.

Cheers!
Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints
Quote:Original post by Zyndrof
I've been having this question in my mind for a while now and thought I should ask.
C++ was created in the 80's and still it is one of the most popular languages for creating software. How come there haven't been any language to surpass C++ in these 26 years? And what makes C++ one of the most powerful languages out there? Is there any language that can compare with C++?

C++ isn't more "powerful" than other languages, except for one fairly irrelevant thing. It's easier to get it to work with really low-level code (ASM, for example) than with most high level languages.

But hardly anyone ever needs that, so let's disregard that for the moment.
In all other respects, it's no more powerful than other languages.

Quote:
Then, what is the point with C++? :/

Legacy. It's widely used and widely supported. Nothing else.
Quote:Original post by Anonymous Poster
Quote:Original post by Zyndrof
C++ was created in the 80's and still it is one of the most popular languages for creating software.

You mean "popular in games" only, right? No sane person would think of getting close to C++ for doing regular applications these days, and that's 99% of what is done in IT.

I... Er... What? Popular in games? My gosh! From my experience, games programmer are late adopters of C++ - not their fault, they had to wait for sufficiently good compilers in order to be able to create these wonderfull games. But do you really believe that only a tiny 1% of the IT industry is using C++? I ask this because not everyone agree, you know. Of course, you might be right and they might be wrong. But the DDJ is known to be very partial, and you are not, right?
Spoonbender, I have to disagree with you there, having direct control over memory and the use of pointers gives C++ a huge advantage over other languages. You might not use this but a lot of us do.

theTrol
Quote:Original post by Zyndrof
Quote:Original post by escudo825
well I'll just throw an example out since no one else is.

I've used VB (visual basic) before, and though MFC may be similar, I couldn't figure it out on my own. but with VB I sat down with VB6 and had my own calculator built within a couple of day's. without any extra help, and I made my first game with it. though I would recommend VB for general applications since it is really easy to build windowed apps, and I would suggest it to start game programming, I have found c++ much easier and versitile. and I also find working c++ code easer to read then many of the things VB allows.


Your point is that one should start with VB, but C++ code is easier to understand? :P I may have understood you wrong.


VB provides a WYSIWYG editor which makes it easier for people to jump right in and see results.
Quote:
VB provides a WYSIWYG editor which makes it easier for people to jump right in and see results.

So does C++ and C#.

Cheers!
Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints
A language is just a tool. C++ is like a leatherman or swiss army knife; it's fairly well suited to a lot of situations. In some situations, though, there are more appropriate tools; for example, you'd probably be better off writing a text adventure game in a language like INFORM, while the Erlang language was designed to power telephone switchboards. In some cases C++ really isn't useful at all - writing vertex and pixel shaders, for example. It's also not the only 'general-purpose' language around; one alternative would be something like Python, and to my knowledge it's not susceptible to things like uninitialized variable bugs.

A lot of people use C++ when there are more appropriate tools available simply because they feel happier sticking with what they know than with learning something new.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

This topic is closed to new replies.

Advertisement