why is C++ still being over-used?

Started by
257 comments, last by jbadams 15 years, 6 months ago
Quote:Original post by VillageIdiot
I think no matter which way this argument goes, its a moot point. Why should it matter if a newbie is using C++ instead of C#, or C# instead of C++? It doesn't.


It absolutely matters.

If a newbie is impeded less by their language, they learn more/faster. Every beginner (yes, every single one) will be impeded less by using C# or Python... something other than C++. The lack of good tutorials, the rampant pitfalls and traps, having a tiny standard library...

But we've been over this time and time before. If you still don't get it, *shrug* at least you've got the right name.

Quote:
Newbies should research their options and form an opinion of their own.


A great idea. Let's have the least capable person possible make the analysis and decision!


Quote:
In C#, I MUST use a specific interface, since the interface is a nominative type, not a structural one.


Indeed, something that is in my shortlist of 'things in C# I wish were different'.
Advertisement
Quote:Original post by Telastyn

Quote:
Newbies should research their options and form an opinion of their own.


A great idea. Let's have the least capable person possible make the analysis and decision!



You're going a bit too far here. Yes, the decision will be made by the newbie, unless you're his professor or his boss. All we can do in this community is throw our (more or less) educated opinions. We can't force them to chose what we want, nor are we entitled to look down on them or ridicule them because they chose different.

Seriously, the name-calling and the elitist behaviour when we are merely discussing technical matters should stop. As far as I know, nobody around here is Knuth, and I bet even he would be much more modest than some here. How about we just contribute our opinions and let the reader decide which one is more...awesome?
Quote:Original post by VillageIdiot
But that does not make it better, I have no regrets with how long it took me to learn C++.


I certainly do. My development was drastically retarded by C++. I've seen too many come through these forums who're impeded by their language. If something else provides less impediments (for learning, or making a product depending on your goals), it's better. Plain and simple.

Quote:
And I bet you honestly think you are the first person (or at least one of them) to come up with that. I hear it all the time when someone disagrees with me, the reason I use this name is to see how many people resort to it in discussions.


Oh, not at all. I actually was trying to remember if I'd made the crack myself before. And I didn't notice your nickname at all until I read your posts and decided they were idiotic.

Quote:
Quote:
A great idea. Let's have the least capable person possible make the analysis and decision!


They are not the least capable person, they know their goals and abilities better than any of us do. It is not like the advice given here is incredibly more qualified to tell people where they should go, this argument shows that. People here, who have used these languages, can't agree on which ones better. Why not let the newbie decide which one he works best with? I am not suggesting he just choose one, but use both and decide off of that.


Because the newbie is woefully unqualified to determine what is better and why? Largely by definition. And I doubt even the moderates here would recommend C++ for beginners.
Quote:Original post by VillageIdiot

Before they use both, they are almost certainly. But they will be able to make an informed decision if (and only if) they try what is out there and see what works for them.


This is a hand grenade. There are many like it, but this one is yours. If you pull the pin without throwing it far away, you will die.


Seeing is believing isn't always practical.
I see quite a few people comparing C# to C++ which is not an accurate comparison. In .NET a language is just syntax. The problem isn't C# it's the .NET platform and managed memory. C++ will always have an advantage over managed platforms because memory is abstracted in a way that doesn't give you the fine grained control you always need. Garbage collection is optimized but to say it even compares to something like C++ which can be specifically optimized for your game isn't fair. Yes garbage collection is optimized but it's done in a general purpose manner which doesn't always meet the specific needs of many games. For hobbyists it's great but commercial games won't be using it anytime soon.

In terms of XNA and DX10, I never said it sucked, however I am saying it will never be used for mainstream commercial games. It's great for hobbyists and casual games for the XBOX or PC but I doubt you will ever see commercial games written on managed platforms for the next 5 to 10 years unless something changes. I remember when windows didn't give you direct access to the video card and you basically wrote games using dos or WinG (i believe that was it). Then the GameSDK came out (DX 1.0) and revolutionized gaming on windows. Something like that will be need for memory when it comes to managed code, in my opinion. But giving direct access to memory would defeat the purpose of managed code so i think C++ is safe for the time being.

Also, providing a link to slimDx when I said XNA doesn't support DX10 doesn't really compare. SlimDX is just a managed .NET wrapper for DirectX and has nothing to do with XNA. I built a WPF application that needed low level access to directX and exposed DX10 api calls to managed code via C++/CLI which is exactly what slimdx does...it's not that hard to do and is not even compariable to XNA, in my opinion. I'm sure slimDx is great for hobbyists who want to build something in managed code but it's not XNA.
From my own experience, I tried delving into C++; even bought a book that centered around learing C++ for game development. However, by the end of the book, I was still looking at text in a console, and still had a shakey grasp of the fundemental concepts of the language. Then I discovered Python, and Pygame.
After purchesing another book for developing using Pygame, by the end of the book I had functional games that used sound and graphics, and more importantly, a firm understading of the underlying concepts and syntax, but with the clear knowledge that there was even more to learn AS I NEEDED IT.
Now if I evenr get in a masochistic frame of mind, I could always go back and learn more of C++, and implement that using Python.

I know I come off as a Python fanboy, but understand, as a newbie, Python has been the perfect starting point for game development for myself. And I strongly encourage other budding developers to at least give it a shot. Give it a week: with C++, you might be getting around to learning about pointers and such. In a week, I'll be enjoying a full featured game developed with Python.
Quote:Original post by jjguzzardo
Managed languages like like C#, which run on the .NET platform are not ideal for real time 3d games.
The people building 3d games don't seem to have a problem with it.

Look up The robot and racing starter kits, and the countless community made games. Battle Tennis looks amazing.

www.BattleTennis.com - I guess C# isn't any good for 3D games.

I bet if you let someone with an anti C# mindset play the same game twice, and tell him that the second run through was actually a C++ compiled version, he'd 'knowingly' point out how much faster and smoother it was running. [lol]

Quote:Original post by agi_shi
Does C# run natively on Macs, Linux, consoles, or anywhere else? Does it even run natively on Windows without the .NET framework?
C# is standardized and can run anywhere. There are cross platform implementations of it, and they run fine on mac and linux. There is even a C# compact framework which runs on consoles and portable devices.

C++ doesn't run on windows without a proper run time either.

You are just ignorant, and really don't know what the hell you are talking about in general.
Apparently many of you have missed the pile of C++ crap thats been released as "finished games" by the major publishers over the past 5 years.

C++ gives you control of memory allocation, but most programmers in this business have no business having control of memory allocation. They arent competent enough and likely never will be, because they really think that they know what they are doing.

Sure, they are avoiding some cache misses, at the expense of maintainability and proofing/correctness.

By the time the serious problems with their allocation strategy are revealed, they arent working on that project any more. Some poor sucker straight out of college is left to try to clean up their mess, and his best bet is to go ahead and patch something in that misses the cache anyways.

Don't rave about C++'s control over memory allocation due to some fantasy cache optimization you think is important. Its not. If its really that important, you should be programming that routine in assembly language and using the prefetch instructions. What, you arent doing that? Guess it wasn't important after all.
Disclaimer: Once again, I'm not anti-C++

There is a funny double standard here.

People say that under C++ (which used to get the same rep of being slower than C), you should use libraries, which are a bit slower, but handle the low level details for you.

Why handle the low level details of char arrays, when STL String does it for you? Why handle the low level details of arrays? Use an STL vector, which will check the array bounds for you. Want random numbers? Why do it yourself, when Boost.Random will get the job done for you?

So when C++ has a library that will check the array bounds for you, and manage the low level details, it's great. But when a language does it, it's evil and too slow. Despite the proven by studies small speed hits, these libraries are 'good enough for general use'. Even though they cause the same pitfalls you guys talk about with C#, like not being able to move around tons of memory every frame, and all the other things you see in the EA STL article.

These arguments are always one part misinformation, one part stigma, one part elitism, and one part knee-jerk emotional attachment.

Lots of programmers are not as good as they like to pretend they are. And the answer to all the misbehaving bad code bases out there, written by people who need to have control of everything, and then blame the OS when their program dies a sudden, horrible death. I for once know that there is nothing better than a program that goes from 0 to crash to desktop without error message in 0.0004 seconds, because the programmer was too damn clever for his own good.

When C++ came into mainstream, it ushered in a era of it being completely okay to ship software that just plain doesn't work. Every random jackass is hacking up all kinds of over engineered solutions that are no good for anything but crashing, or causing all kinds of other problems. And then the blame game is played, until you finally find out who wrote the bad pointer code.

So the answer was to start writing modern OSes like cops to shield the users from all these crashes, and then have to hack up their backwards compatibility functionality on a program by program basis to work around all the irresponsible memory access hacks the original authors of these programs took just to be clever. So some of these programs took upwards of a 10% speed hit, but they stopped crashing to the desktop, and executed normally.

I'm glad that newer languages flag pointers as unsafe code. Because that's exactly what they have always been. C++ has a fundamental design flaw in that it gives so much power to so many incompetent people.

C++ went ahead and changed checking for null after NEWing something, t something else by default, and I didn't find out for years. How many 'pros' are still doing this and have no clue?

Most programmers in general are incompetent and irresponsible to begin with. Why do games, still to this day, require admin access to play? Most of the time because the programmers are afraid to learn something new and do something as easy as saving the user data to their user folder. Why write a few extra lines of code to remove the admin requirement and just save in the proper spot, when you can spend that time over-optimizing something else that will let them drive into a wall 0.00001 percent faster.

These same people bitch about UAC and signed drivers, because it forces them to write boring responsible code. It's much easier to tell the user to disable UAC and give the program admin rights then it is to save in the right folder.

Remember, C and C++ were designed originally as a language to write system level software that actually needed all these privileges and direct access. It has been shoe-horned into a general purpose language and did a poor job of it, because most of the people using it are not are not able to be experts on everything, and remember all of C++'s quirks and sometimes strange behavior.

C and C++ have always been described as languages that were all powerful, fast as hell, but would also let you shoot yourself in the foot. The language also lets you do moronic things because it assumes that you know what you are doing. And most don't! The sad fact is that most people have shot themselves in the foot. These languages have a strange culture of people who obsess about over-engineering, over-optimization, and speed no matter what the cost.

And back to games, where people are using scripting languages for all the logic anyways, and leave the C++ code to the actual engine (like XNA, calling the native DX stuff), taking similar small hits. Everything seems to be fine as long as the name C++ is still in the equation. Every language has pros and cons, and stuff that needs to be optimized around.

Programming would be in much better shape if people stopped becoming so emotionally attached to a language of choice, or hiding in their safe areas, and used smaller, easier, domain specific languages that were focused on getting specific jobs done. Doesn't really matter I guess. Once upon a time, people were too good to use C, because they were clinging to the tit of their own language of choice.

It's just a big cycle. People are resistant to change. And there is always that 10% who think themselves above everyone, and need something to separate themselves from the pack, priding themselves on the fact that their trivial app has the power to hose your whole system when it bugs out. [lol]

Maybe one day people can have an objective discussion on C++ without a brigade of threatened apologists rushing to it's un-needed rescue.
Quote:Original post by Daaark
And there is always that 10% who think themselves above everyone, and need something to separate themselves from the pack ...


Yeah. I guess I can see that.

Quote:Original post by Daaark
You are just ignorant, and really don't know what the hell you are talking about in general.

...

Lots of programmers are not as good as they like to pretend they are.

...


Every random jackass is hacking up all kinds of over engineered solutions that are no good for anything but crashing, or causing all kinds of other problems.

...

C++ has a fundamental design flaw in that it gives so much power to so many incompetent people.

...

How many 'pros' are still doing this and have no clue?

...

Most programmers in general are incompetent and irresponsible to begin with.

...

These languages have a strange culture of people who obsess about over-engineering, over-optimization, and speed no matter what the cost.

...

Once upon a time, people were too good to use C, because they were clinging to the tit of their own language of choice.

...

Maybe one day people can have an objective discussion on C++ without a brigade of threatened apologists rushing to it's un-needed rescue.


These kinds of threads would be a lot less annoying if they weren't always so full of net-tosterone.

This topic is closed to new replies.

Advertisement