• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Zyndrof

What makes C++ so powerful?

148 posts in this topic

Quote:
Original post by Zyndrof
How come there haven't been any language to surpass C++ in these 26 years?

This implies that popularity == power. This is not true in this case. Common Lisp is much more powerful when it comes to metaprogramming and Erlang is more powerful when it comes to concurrency or distributed programming, for example.

Quote:

And what makes C++ one of the most powerful languages out there?

By my definition of "power" (the easiest to use for the task at hand), it is generally one of the least powerful languages still in fairly common use.

Quote:

Is there any language that can compare with C++?


That depends on the task, but for most tasks, there are quite a few. You just may have never heard of them or used them.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by nullsmind
I agree with him partially but his response reminds me of an unsocial brat. I'm not suprised his sad life is wasted here on a daily basis. Anyway, I'm thankful that I don't have to deal with it any longer due to a new focus that's more realistic in the real world. I'm sorry that the rest of you have to deal with Oluseyi.

Just a little push to help you with your "new focus."
0

Share this post


Link to post
Share on other sites
D looks like it might rise in popularity, maybe...

Usually a 'powerful' language, means low level access to the OS.. In other words, you have power over the hardware.

Using that definition C / C++ are very powerful, and Java is a pussy cat ;)

As for the ppl who think that all IT work must be done in managed languages - this is because if you give power tools to children, they're likley to lose a finger or two. Powerful languages are like power tools, managed languages are like safetey scissors.
You can still get everything done with your scissors, it might even be easier most of the time, but you're gonna end up with a lot more crap that you needed (like writing HTML with MS Word).

Everything that managed languages do (garbage collection, safe arrays, etc..) can be done with C++ using classes to encapsulate the behaviour. It's just not there by default, you actually have to make decisions about which objects should be handled with handles, which will be directly deleted, when bounds checking will happen, etc etc, instead of just doing it all for everything.

In short, if get urself a good C++ runtime/static library, theres no need for safety scissors (provided you understand that * and & mean you have direct access to memory, and use them properly, or get a class to handle them for you)...
0

Share this post


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


You, sir, are a moron. This statement is complete fantasy.


Agreed. C++ is used for a very large proportion of 'regular applications'.

Although where I work now, i write tools for the creative department, and we chose to write all our apps in PHP, even though it is literally 400 times slower than C...
0

Share this post


Link to post
Share on other sites
An interesting observation, if I may.

Most of the users extolling the virtues of C++ are fairly new, lower rated users, several of whom I know for a fact are fairly new to programming. The people advocating a more balanced and inclusive viewpoint are higher rated users, several of whom have been on this forum for quite a lot of years.

I don't endeavour to insult anybody here. However, I feel that this is a fundamental insight into the nature of the discussion. If you have never done serious work in a language other than C++, you are not qualified to comment on the strengths and weaknesses of C++, let alone those of other languages. If you have never worked in C# or Java, you have no business talking about the performance of managed languages or garbage collection or JIT or any of it. If you're going to claim a language can't do something, be damned sure to do your research first (a quick search for C# operating system brings up Microsoft's Singularity project).

At the end of the day, I'd caution you all about whose advice you take and how seriously.
0

Share this post


Link to post
Share on other sites
I am not sure about powerful, but for popular probably because its a very versatile and well rounded language, as stated before there are more powerful languages but they probably aren’t as suitable as c++ for every application.

Also a lot of the interpreted languages require a properly set up framework/JIT/interpreter/whatever and are easy to decompile, this makes commercial application developers a bit squeamish, as they’ll probably be supporting and updating the same app for decades.

Finally of course there is legacy, even if c++ isn’t the simplest or the fastest to develop who cares if I can complete 95% of the programming requirements just by patching together 3rd party libraries.
0

Share this post


Link to post
Share on other sites
C++ is popular because it is an improvement on C which was widely taught in universities which were running UNIX which had very attractive academic licensing conditions.

This says nothing about the merits of the language itself. People use what they are familiar with. Scientists and engineers still use and learn Fortran, after all.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
D looks like it might rise in popularity, maybe...


The problem with D is that people have been saying for a few years now 'oh it will rise in popularity' and... well, look where it is now?

0

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Quote:
Original post by Anonymous Poster
You, sir, are a moron. This statement is complete fantasy.


Agreed. C++ is used for a very large proportion of 'regular applications'.

Although where I work now, i write tools for the creative department, and we chose to write all our apps in PHP, even though it is literally 400 times slower than C...


Haha, in what planet? C++ is a productivity killer, anyone using either know exactly what it's doing, so they know they need C++ and why, or it's a complete noob that learned how to program last year and think he's the "super programmer" only because he heard C++ is "for th3 l33t".

There are tons of more productive environments for working, and languages that aren't as retarted as C++ for "regular applications" *.

In all these years I am still to meet a single C++ developer. Any of the simpler apps used to be done in VB or Delphi, now many migrated to either Java or C#. In the web the "quick'n dirty" stuff is done either in PHP or Perl or Python (and now Ruby), and more complex stuff that requires more power is usually done in Java.

You must be really a masochist to use C++ outside kernels, device drivers or games. I would like to hear real developers here to say otherwise and why, not unexperienced boys that think that know everything about everything.

* regular applications: forms, apps with database access, web services, web applications and simple stuff like that.
0

Share this post


Link to post
Share on other sites
I worked at a place that we made UML modeling tools, we did all of our programming in C++. I doupt we could have done the same stuff in any other language, and before you you say we didn't know what the other languages could do, we did reverse engineering for VB, Java, C# and C++, so we were quiet well versed in the others. When you are do low level work there is no better langauge. Now with that being said, most of what I do now days is in C#. Programming langauges are just like ethics, they are all situational. What language is the "best" depends on the situation, nothing else.

theTroll
0

Share this post


Link to post
Share on other sites
As someone who only really knows C and C++, I am curious. What exactly do people percieve as being the problems with C++? And how do other languages improve upon or solve these problems?

This is not a flame. I am genuinely interested to hear what people think. My own opinion is that I have never found a feature of C++ that I couldn't build a workaround or wrap-up for if I didn't like it.

Stroustrup has said in interview that his design decisions for C++ were drawn in part from his philosophical interests and readings and the belief that you should not impose restrictions on the way people choose to do things. He has also stated that he was not interested in creating a language to help out bad programmers but to give an edge to good programmers.

On the flip side, I read an interview with the guy who designed Java (forget his name) who said that he had left out operator overloading from the language because he had seen it so often abused in other languages before. Perhaps when considering programming in teams and reusability of code, this is a valid reason. I am not sure.

Paul
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Oberon_Command
Quote:
Original post by Spoonbender
If you really disagree with me, then show me a program in C++ that couldn't have been made using C#.


An operating system? You would need a C# compiler that compiles to native binary, and to the best of my knowledge there aren't any...

You can't write an operating system purely in C++ either. You're going to have to use *some* assembly.

0

Share this post


Link to post
Share on other sites
Hey. I just got into this place because RPG-Dev has been blocked from the connection I'm using (Z!re hates me...). I would log in but the place where my email is is also blocked. I know this is kinda off-topic, but just about everyone says Java is better than C++. I don't get it. Java isn't better than C++ in anything that I can think of. Albeit that it is better in rendering 2D graphics, but still...

I have a question. Does anyone think that Java is better than C++? Or is C# better than Java? Or is C# better than C++? Which one is best?
0

Share this post


Link to post
Share on other sites
Greetings,

I've noticed several of these threads popping up lately. We're seeing more and more with topics such as:

  • Why is C++ so powerful?
  • Why is Java not used in more games?
  • Which programming language should I learn first?
  • Which is better - C++, Java, or C#?
  • I know VB - should I learn a different language for game development?

These are honest questions (most of the time) but nearly always result in a flame-war. Would it possible to get an enlightened moderator or someone to write a thoroughly researched, objective, thread - simply comparing the different languages for the purpose of game development, so that it might be stickied or FAQ'd for speedy reference. Then whenever we get a question such as this we can just say:

Chech here. Or 'Read the FAQ.'
0

Share this post


Link to post
Share on other sites
Quote:
Original post by EasilyConfused
As someone who only really knows C and C++, I am curious. What exactly do people percieve as being the problems with C++?


Unordered:
1. Template metaprogramming is awkward. Creating loops and linked lists using templates should be easier.

2. Templates have to be fully defined in header files.

3. Local classes are second-class citizens. This makes using algorithms like "for_each" awkward.

4. "Real" garbage collection is awkward to implement and enforce. Sometimes, it is nice having "Real" garbage collection.

5. No anonymous functions.

6. Boilerplate code required for message forwarding (ie, if I want to write a non-polymorphic class "that is a vector, except.." it requires every method to be manually forwarded.)

7. Horrible VARARGS implementation.

8. No named function parameters.

9. Lack of decent "output only" parameters to functions.

10. Leaking of the const system.

11. Easy execution of undefined behaviour and/or non-deterministic behavriour. (It should be possible to create an uninialized variable -- but that shouldn't be the default behaviour.)

12. Lack of standardization on a good string class. (std::string has issues)

13. Inheritance and operator=, etc.

14. Boilerplate code requirements: operator& should (by default) imply operator&=, and vice versa. (and yes, this should be optional - but as it stands, the operators are unrelated)

15. Lack of run time functional composition. (boost solves this somewhat)

16. Annoying magic with operator->, operator., and the like.

17. Streams use of operator<< and operator>> seems very cludgy.

Those are just some annoyances off the top of my head.

Don't get me wrong. I like C++. I just can't want to get my hands on the language after the increment happens. ;)
0

Share this post


Link to post
Share on other sites
Just throwing my 2 cents in here. Until something comes along that will replace C/C++ in the embedded environment, it's going to be around for a long time to come. It's not because C/C++ is fast and/or easy to develop with. It's because the senior people working the projects know it. There's a whole history of proven work that can be reused. Reliability is HUGE in embedded environments. You can't always just download a patch/fix/update. Once it's shipped, it has to work. If it ain't broke, don't fix it.

None of that means there isn't anything better to replace C/C++. If you look at it from a program managers point of view, though, it would be risky and costly to try something else.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by EasilyConfused
Stroustrup has said in interview that his design decisions for C++ were drawn in part from his philosophical interests and readings and the belief that you should not impose restrictions on the way people choose to do things. He has also stated that he was not interested in creating a language to help out bad programmers but to give an edge to good programmers.


People only tell first half of the story. "Freedom" will often sound good but we are not free from the consequences of our choices. We will never be. That makes me wonder, what's freedom at all?

In programming, would you choose an abstract term "freedom" (actually the freedom is something that someone is trying to sell you) instead of a tool that offers features that could prevent errors, foster good practices and organization, gains in productivity?

We are not painters or sculptors that need only a blank screen or a piece of rock and the creativity does the rest! We need more elaborated tools, and if tools can take the burden off our shoulders then it's a good thing.

One example of cool thing in Java is the mapping between packages and directories, one package = one directory, this simple feature guarantee that no idiot will ever create an insane structure for an application and we always know where to look for the classes.

The exact "l33tness" thinking of "not interested in creating a language to help out bad programmers" is what will kill C++ eventually, and Microsoft succedded doing the exact opposite.

I bet sometime around the 70s some moron would say that normal people shouldn't get near computers, look now, who was right? Just stop to think for a minute. Things tend to getting easier every day.

The "freedom" argument seems more like it was created by a bunch of hippies. The "l33tness" argument seems more like it was created by a bunch of nazis. I don't think both would survive in this world for long.

Quote:
Original post by EasilyConfused
On the flip side, I read an interview with the guy who designed Java (forget his name) who said that he had left out operator overloading from the language because he had seen it so often abused in other languages before. Perhaps when considering programming in teams and reusability of code, this is a valid reason. I am not sure.


I believe that's a very valid reason.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Hey. I just got into this place because RPG-Dev has been blocked from the connection I'm using (Z!re hates me...). I would log in but the place where my email is is also blocked. I know this is kinda off-topic, but just about everyone says Java is better than C++. I don't get it. Java isn't better than C++ in anything that I can think of. Albeit that it is better in rendering 2D graphics, but still...

I have a question. Does anyone think that Java is better than C++? Or is C# better than Java? Or is C# better than C++? Which one is best?


it depends on what you are doing really, i can't say anything about C# since i havn't really used it much yet. but Java has quite alot of advantages, almost 100% platform independance, pretty decent multithreading support (far better than C++), garbage collector, and more. its generally easier to work with and its not really that much slower if you use JIT compilation on a decent VM.

basically the main drawbacks of java is that it forces you to use OOP (or heavily abuse static classes) and that it relies on a VM, the VM is a major advantage in many situations though, (since it allows your program/game to run on any platform that has a Java VM avaliable).

the only real advantage C++ has these days is the large amount of libraries and engines made for it. and ofcourse the tiny amount of extra performance you can squeeze out.
in most cases you won't need that little extra performance though, and using a language that lets you focus on getting the work done would be preferable.

C++ is my favourite language in most cases, however im doing roughly 80% of my work in java these days. (simply because its fast enough for what im doing and it allows me to get the work done in less time).

ofcourse C++ also has the advantage of being easy to compile to native code. (there are some native compilers for java but the ones i've tried have been absolutely horrible).
0

Share this post


Link to post
Share on other sites
Ok, ok.. c++ here, c++ there.. I can think how good it is. I am just a young german pupil (sry for my bad english..). I program in delphi ( = pascal), but I want to start programming 3d games. Do I have to start learning c++ or is there an easier alternative? In the long run I want to have professional solutions, but now, I dont think that I can learn c++ as fast as I want to produce my own 3d game.

Hope u could understand me ;-) and hope that anyone can help me.
0

Share this post


Link to post
Share on other sites
I think you should read this thread again and if ur still not sure, stick with delphi.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Stresemann
I program in delphi ( = pascal), but I want to start programming 3d games. Do I have to start learning c++ or is there an easier alternative?


You already program in Delphi? Stick with it. I'm sure you can find an opengl implementation for Delphi around. Take a look at 3D and OpenGL w/Delphi

I'm not saying don't learn another language, but if you want to get started I don't see a problem with Delphi now. It's absolutely wonderful for Rapid Application Development.

On a side note:

I would love to see anyone make a game in Java or C# that can compare with a AAA title written in C/C++. Maybe as a proof of concept, or maybe to learn that the language is a tool and some tools are better than others at certain jobs.

-Dagbud
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Arild Fines
Quote:
Original post by Oberon_Command
Quote:
Original post by Spoonbender
If you really disagree with me, then show me a program in C++ that couldn't have been made using C#.


An operating system? You would need a C# compiler that compiles to native binary, and to the best of my knowledge there aren't any...

You can't write an operating system purely in C++ either. You're going to have to use *some* assembly.


I know that... I meant as a kernel, but it looks like I've been proven wrong. Oh well...

Actually, it's easier to write an OS in C than C++. In C++ you have to write a whole bunch of extra support code to get it working properly. I tried to get C++ working when my kernel was really young, and I couldn't quite get it to work. Either it wouldn't compile (that's what happened most of the time) or it would compile but it wouldn't run properly, if I didn't get a GPF it would print gibberish when I tried to print a test message (probably a memory issue). Someday I'll get it working...
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Does anyone think that Java is better than C++?

I prefer Java over C++ for a couple of reasons. These come to mind:

Java does not have a retarted compilation model. There is no preprocessor, you don't need includes and forward declarations, there is no need for .h and .cpp files. Honestly, how many beginners get frustrated at the very beginning just because of include guards, missing forward declarations and stuff like that?

Java projects compile damn fast (I guess because there's no need for preprocessing... imagine how many lines a simple 'Hello World' C++ application gets bloated up to by the preprocessor just by #including two or three header files). For example, my current tetris clone which consists of 40 classes needs just a single second for a complete compile from scratch!

Java has garbage collection. This means that you do not have to worry about memory management. How many beginners make the mistake to return a reference to a local variable? How many programmers forget to clean up after themselves? Who is responsible for deleting heap-allocated objects that a function returns? Garbage collection means: less bugs, less time needed to write the code, less code to maintain (and less code to be cached!), improved productivity.

You can achieve more with less time and less lines of code. This is my definition of a "powerful language".
0

Share this post


Link to post
Share on other sites
Quote:
Original post by swordfish
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++?


What about D ?
http://www.digitalmars.com/d/index.html

It provides the features of C/C++, can link against C-DLLs, allows to transparently use COM-Objects, allows the use of templates (with a much simpler syntax than C++ offers) and much more.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Fred304
Java does not have a retarted compilation model.
The Java compilation model does not suffer the brain damage of the C++ model, admittedly, but it has its own problems. The structure of the class loader is psychotic, and the forced tie in between packages and filesystem directories is irritating (and necessary due to the class loader's design). Conventional class factories basically don't work due to how static initialization is handled (yet another consequence of the core class loader design), which basically forces some sort of reflective factory use or some other similar model. The list goes on.
0

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  
Followers 0