Jump to content
IGNORED

Is C++ really that bad?


JDTAY

Recommended Posts

I know this forum is for console programming, but I wasn't sure where else to discuss this. I saw some people making fun of C++ in another thread. It's the language I have the most experience in, and it took a while to get used to, but now that I am, I don't see much wrong with it.

 

Maybe I just haven't experienced a good language yet? Only other ones I've done are BASIC for Sega Genesis, Perl for modifying a chatbot, and merely studying Z80 assembly. I admit, I remember the Perl being a lot easier to work with than C++, but all I was using it for was text-based stuff. Not sure how well Perl works for games.

Edited by JDTAY
Link to comment
Share on other sites

What's a good way to learn which C++ methods are evil? I wanna optimize my games as much as possible because I plan on running them on a handheld device with a 1.5GHz dual-core processor. As simple as my games are though, it probably doesn't matter, but I figure every bit of RAM, ROM, and battery life I can give back to the user helps.

Link to comment
Share on other sites

What's a good way to learn which C++ methods are evil? I wanna optimize my games as much as possible because I plan on running them on a handheld device with a 1.5GHz dual-core processor. As simple as my games are though, it probably doesn't matter, but I figure every bit of RAM, ROM, and battery life I can give back to the user helps.

 

I am sure there are various different opinions you can google for. A lot depends on the compiler used as well.

 

Good luck.

Link to comment
Share on other sites

I've been a professional C++ programmer for many years, and it's one of my favorite languages, second only to the majesty of Ada.

 

C++ is a very powerful language, but it's one that won't stop you from writing bad code. The worst C++ tends to be written by people that learned to program in languages like Java and C#, languages which superficially seem similar to C++, but in practice are very different. Whenever I see people ragging on C++, it's usually one of these folks that want to write C++ as if it were C# and are frustrated when their code breaks all the time.

 

Now, there are many legitimate criticisms of C++, but it takes a lot of knowledge before you really know what those are. Most gripes that I see are rooted in a lack of understanding, most things in C++ are the way they are for a very good reason.

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

There are languages that handle concurrency, parallelism, have stricter type checking, etc... but that doesn't make C++ bad.

Some things about C and C++ can cause problems though.
Include files and templates can shorten your code a lot, but they can have some unintended consequences.
If you don't know what's in them, you might have some issues. But that's more the programmer's responsibility than the language.

C++ can be a little cryptic. When you are getting to know someone else's code it's not quite as obvious as some other programming languages.
But let's face it, digging through someone else's code so you can modify it takes time.

People complain that it doesn't have garbage collection... but if you are a good programmer I really don't see an issue with it.
I think people want to have the language do things automatically for them instead of them following certain programming practices.
C++ doesn't really do things automatically other than call constructors and destructors..
Hand holding isn't included in C++..

Some people even argue against how it implements objects.
There are people that think inheritance is evil (more unintended consequences), especially multiple inheritance.
But just like include files and templates... you need to know what's in the code you are building on or you can have problems.
And there are more complaints. There are pages and videos dedicated to this stuff.
What one person complains about, someone else will rave about.

There are some advantages to languages like Go, Rust, Java, Swift, etc... but they have their own quirks.
Some languages make it more difficult to get into certain kinds of trouble, but that doesn't mean you won't write buggy code in spite of that.
And you can certainly write good or great code with C++.

Link to comment
Share on other sites

C++ can be really clean or a hell-of-a-code, but depends on programmer.

 

Because it builds up over C, many people finds it difficult to understand. I find it pretty useful.

 

IntyBASIC is built with C++ and looks clean enough for me https://github.com/nanochess/IntyBASIC

 

And yep, C++ is the language of choice to write good PC games in the modern times. Every succesful game out there is now written in C++ (Halo, Gears of War, Bioshock, Last of Us)

Link to comment
Share on other sites

C++ is my favorite language too. I did C++ professionally for years before the market turned out to the "horrible" Java , Javascript etc...

 

As other says you can do good c++ and bad C++ , it is not due to the language but to the coder.

 

May front end for Arcade Cabinet (atomicfe : http://www.atomicfe.com) , is enterily done in C++.

 

i have also did few PC games in C++ .

 

For me with C++ you got the benefits of Object Oriented Programming together to the the power of C . And in addition you can easly put directly some inline Assembler code when really needed.

  • Like 1
Link to comment
Share on other sites

The language per se is rarely the issue, but there are languages that make it way way too easy to shoot oneself on a foot .... usually those tends to be more powerful in a way (they do work usually at a lower level of abstraction).

 

C++ has evolved a lot since its inception and got better at some. In the end it depends on what you need to do.

There's always a quick way to perform the task in a higher language but it may not have the same performances, if that matters that is, sometime expediency is all that's needed, some other time expediency is the opposite of what's needed and instead one wants predictability (so garbage collected languages tend to NOT satisfy this requirement, but not in all circumstances so automatically ruling them out is also a mistake).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...