Considering move to C++

Started by
14 comments, last by blewisjr 11 years, 4 months ago
Object-Oriented programming hardly produces error-prone, mangled code. In fact, I would say (And this is someone who came from only procedural programming to C++ around two years ago) that object-oriented programming reduces errors, nevermind making your code far more understandable.


if (Object.size() < Object.MaximumSize)
{
Object.IncreaseSize;
}

This code makes sense, rather than having to use weird structs and arrays, or collections of values that require commenting to explain the correlation. I also recently wrote an article on The Auto Variable (A great new C++11 feature).

As a list, well, I'm not sure. Here are some (very useful) highlights:

  • The Auto Variable
  • Constexpr
  • Vectors
  • Objects, in General
  • auto pointers
  • weak pointers
  • etc.

There are just far too many great C++(11) features. C hasn't been updated since 1999, also, which means many C++ features that are commonplace in many programming languages now might never reach C (However I hope they make a new standard, it's definitely rejuvinate the language).

I'm a game programmer and computer science ninja !

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here !

Advertisement

C hasn't been updated since 1999

Well, there is the C11 standard, which came out in ... 2011.

Object-Oriented programming hardly produces error-prone, mangled code. In fact, I would say (And this is someone who came from only procedural programming to C++ around two years ago) that object-oriented programming reduces errors, nevermind making your code far more understandable.


if (Object.size() < Object.MaximumSize)
{
Object.IncreaseSize;
}

This code makes sense, rather than having to use weird structs and arrays, or collections of values that require commenting to explain the correlation. I also recently wrote an article on The Auto Variable (A great new C++11 feature).

As a list, well, I'm not sure. Here are some (very useful) highlights:

  • The Auto Variable
  • Constexpr
  • Vectors
  • Objects, in General
  • auto pointers
  • weak pointers
  • etc.

There are just far too many great C++(11) features. C hasn't been updated since 1999, also, which means many C++ features that are commonplace in many programming languages now might never reach C (However I hope they make a new standard, it's definitely rejuvinate the language).


I am not saying OOP is error prone what I am saying is that OOP can lead to abstractions that go too deep which leads to harder to maintain code. You can find numerous threads here in the GDNet forums where people have a hard time finding certain bugs because their abstractions are far to complex for the problem they are trying to solve. The issue arrises because people tend to abuse inheritence. From a side node understandable is more of a personal preference. For instance I find it easier to understand and learn procedural libraries then heavily abstracted libraries. It is not that I have a problem with OOP I use it when it makes sense in Python all the time when writing scripts and such the issue with it have have is the over abstraction and abuse that comes from it.

Yes the C11 standard came out very close to the C++11 standard the issue with C at the moment is none of the compilers care to implement the newer C standards to this day the only full C99 compiler I know of is Pells and maybe Intel. GCC has some support and MSVC has terrible support.

It comes down to the fact for me that there are certain aspects of C++ in the new 11 standard that I really like and really wish were in C. In all honesty one feature that would make a world of difference in C is namespaces but they still don't exist in any compiler I have used.
Yes, OOP can lead to unnecessary abstractions in hands of an inexperienced programmer. Functional programming can lead to overcomplicated, not understandable and unclean code. None of these pitfalls is a reason not to use these paradigms, just a reason not to use libraries which abuse them.

Yes the C11 standard came out very close to the C++11 standard the issue with C at the moment is none of the compilers care to implement the newer C standards to this day the only full C99 compiler I know of is Pells and maybe Intel. GCC has some support and MSVC has terrible support.


Clang has the best support for both C11 and C++11 at the moment as far as I am aware. GCC is second place with C++11 support. MSVC has no support at all for any C dialect other than ANSI C and has poor C++11 support (comparatively speaking). Intel I have no idea about other than they have good support for C99. No idea about C11 or C++11.
I agree Clang has the best support with GCC as a close second right now I use GCC for my toolchain through MinGW due to better windows support than Clang which requires a bunch of muck around to get to work properly. If I was running Linux or a Mac I would use Clang in a heartbeat but even on Linux it would require custom building of all your libraries. Microsofts compiler is great but they are just too slow to implement standards.

This topic is closed to new replies.

Advertisement