Sign in to follow this  
Zyndrof

What makes C++ so powerful?

Recommended Posts

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++?

Share this post


Link to post
Share on other sites
Guest 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.





Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
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 don't know, you're the experts :P Then for regular applications, what is the most popular?

Share this post


Link to post
Share on other sites
All the jobs that I have worked on reciently are still C++, these are not legacy project but new projects. C++ is not just a legacy language.

theTroll

Share this post


Link to post
Share on other sites
What makes C++ so powerful?

The first thing that comes to my mind is object orientation.
The 2nd thing is templates.
The third thing is that it's based on C and uses familiar syntax and conventions.

How come there haven't been any language to surpass C++?

This all depends on your perspective. Some would say Java surpasses C++.
As far as prototyping is concerned, I think ObjC/ObjC++ surpasses C/C++ - but that's just my opinion.

You have to think too, that C/C++ has become a sort of unified language of the world - sort of like math. Overall, I think it would have to fall down to C++ being so familiar to everybody.

..It just makes sense.

Share this post


Link to post
Share on other sites
If it is most popular only for games, is there any language that can manage to do the same stuff as "easy" (or easier) than C++?

Share this post


Link to post
Share on other sites
Quote:
Original post by Zyndrof
If it is most popular only for games, is there any language that can manage to do the same stuff as "easy" (or easier) than C++?

Every other language ?!

I'm sorry if I didn't see your sarcasm tags...

Share this post


Link to post
Share on other sites
Quote:
Original post by Alpha_ProgDes
Every other language ?!

I'm sorry if I didn't see your sarcasm tags...


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

Share this post


Link to post
Share on other sites
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++ :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Quote:
Original post by jwalsh
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!


He was making a comparison between C++ and VB therefore C# was out of context. I believe VC++ has a WYSIWYG editor but C++ in general does not. Of course the WYSIWYG editor for VB could also be seen as an IDE feature but VB is tied to that particular IDE a lot more then C++ is to any IDE.

Share this post


Link to post
Share on other sites
Quote:
Original post by TheTroll
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.


smoke, mirrors and illusions my friend.
You don't have 'direct control over memory' on ANY modern OS, just try writing to somewhere you haven't been given and watch the OS jump all over you, scream at you and shut you down.

Pointers are just another way to screw up and the area most people new have the biggest trouble with, no advantage here.

Don't get me wrong, I'm primarily a C++ programmer, but neither of those are 'advantages'


Share this post


Link to post
Share on other sites
A language does not have a WYSIWYG editor, none of them. What does have a editor is the IDE. The editor has nothing to do with the langauge, it is just an IDE tool for helping you design your UI.

theTroll

Share this post


Link to post
Share on other sites
Quote:
Original post by tstrimp
Quote:
Original post by jwalsh
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!


He was making a comparison between C++ and VB therefore C# was out of context. I believe VC++ has a WYSIWYG editor but C++ in general does not. Of course the WYSIWYG editor for VB could also be seen as an IDE feature but VB is tied to that particular IDE a lot more then C++ is to any IDE.


Basic doesnt have a WYSIWYG editor. Visual Basic does. Hence the "visual" part. C++ doesnt have a WYSIWYG, but Visual C++ does. They are the same thing really, and not coincidentally, both Microsoft inventions - and both standard with "Visual Studio." Its just that Borland/Inprise and other IDE makers have created their own "visual" tools for C++, while no one has bothered with Basic that I know of.

Share this post


Link to post
Share on other sites
Hmm... Whenever I start to feel that I have a little hang of this programming thing, more questions comes to mind and more answers makes more questions :P

I recently won a book on VB.net and am trying to decide if I should focus on C++ at the moment or start VB.net instead. It's hard not to use the book that lies waiting in the shelf :/

If my long-time goal is to start (or at least try) game programming, would VB.net be an alternative? The thing is, if I like doing game programming, there shouldn't be any problem switching to a more suitable language for the task. But if I find out I don't like it and want to stick with regular applications, what are the pros and cons of C++ and VB.net?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this