If you're starting out C++ and not use to cleaning up after yourself, find a simple smart pointer class! One with a reference counter (they automatically delete when they loose scope!), and you can kind of treat them the same as in a native-GC language like Java.
Colonel Kernel wrote:In my experience, few applications are developed in C++ anymore... it's usually C# or Java these days.
Umm.... that's just your experience. In my experience in the video game industry C++ is used near universally in game frameworks, game code, and related development tools. C# is SLOWLY catching on (you find the odd editor or compile tool written in C#) but it's not common enough for me to rank as "usually".
And it's not just because of legacy code either. Everyone once in a while frameworks get re-written from scratch (that's why some projects start 4 or so years before they're released).
There are a few reasons why I think the video game industry sticks with C++:
- The APIs (Direct3D, OpenGL, PhysX, Havok, Speedtree, etc) are all C/C++ based (so I guess it is kinda for legacy stuff in a way).
- Everyone else in the industry knows C++ (imagine how much harder it would be to get a job if languages were an extra criteria).
- Even if a language isn't hard to pick up (Java/C#/D for a C++ programmer), a team would rather use a language that everyone knows all the ins and outs of when they're working to a deadline and have to write performance critical and stable code, rather than spend the time experimenting the different features of the language.
I'm all welcome for change, but since C++ has established itself I don't see it moving for a quite a long time.
I know D has certainly proved itself in performance (and simple to interop with C/C++ libraries), but the community is still rather small and I don't see any mainstream developers (or middleware developers - who can force you to use a certain language if your manager is set on using their framework) pushing it (or any other language) for it to become a major influence.
I don't know of what general application development or systems programming is in general, but I'm guessing it's the same scenario.