Quote:Original post by Takaloy
c# is like a CRV, easy to drive, easy to use, easy to learn.
C++ is a F1 Ferrarri. It's difficult to grasp, but much better in terms of performance compared to c#.
Define preformance.
For a business app, I'd most likely define this to be "how fast can I get it to the shelves/my employer". A RAD (Rapid Application Development) toolset, and simple-to-use language win here, not C++, with it's big can of "undefined".
For a typical FPS, I'd most likely define this to be "how fast can I get my framerate with the latest graphics". Most of this work is done by your graphics card. Hardware engineering and shader languages win here, not C++.
For some AI-heavy strategy games, or some games with whackilly expensive physics simulations, or scientific number crunching, C++ may win. CPU or Memory tends to be the main factors here.
Languages that are not C++ have some or all of the following advantages in those two categories:
CPU:
* Garbage Collection: No need to clean up blocks if the program terimnates before running out of memory. Can relocate memory blocks used at the same time together, reducing time spent waiting for pages to load. No counter (de)incrementation for reference counting multi-owner objects.
* Platform-specific JIT: No need to target the lowest common denominator of CPU instructions and optimization techniques, can be custom tailored to local system.
Memory:
* Garbage Collection: No memory leaks. Can reduce fragmentation by similarly relocating memory blocks.
Thus, C++ may still be a loose for systems with both of those problems as limiting factors.
There are few reasons I still use C++. Among them:
1) It's the language I'm most familiar, and thus comfortable, with.
2) RAII for non-memory resources seems harder with many GCed languages (see 1).
3) I hate that the garbage collector can run at basically any time, for an unbound length of time.
I will eventually stop using C++ except for legacy support, reason being:
1) I'm working on learning other languages, if only to steal their ideas.
2) RAII for non-memory resources is quite doable with many/most/all GCed languages.
3) Garbage Collectors are becomming freakin' uber.
Quote:with that said, I think C++ is the best beginner's language. The most important thing is to build up the type of mind set, avoiding sloppy programming because C++ is , err... less forgiving.
I'll disagree here!!! Define "less forgiving". For me, to finish that sentance, I'd say "less forgiving means random undefined behavior at runtime and hard-to-track bugs instead of compiler errors and a system which dosn't allow many bugs to surface in the first place". This would be a definate disadvantage for C++, taking time away from learning to avoid sloppy habbits by forcing you to invest in learning how to use a memory leak detector, among many other bits of knowledge required to get your program running once more.
Quote:If you are already fairly good in C++, other languages come in a click.
Is this because C++ is a superior learning instrument, or because C++ is simply the hardest to learn, and the relative ease of learning another language simply the contrast between learning C++, and said other languge?
Quote:Assume that you're learning to ride a bike on 2 wheels instead of the 4-wheeled type (the ones you see on kid's bike), when you can ride pretty well the 4-wheeled bicycle should be a piece of cake.
I learned to ride a trike before a bike-with-training-wheels, and a bike-with-training-wheels before a bike. I had a lot of fun being able to go places before I was able to learn how to balance, which helped fuel my motivation to learn how to do the same thing without said training wheels. Being able to steer and turn the pedals made learning to balance a whole lot easier. Maybe if you're masochistic, falling a lot while you learn how to steer and turn the pedals would be your idea of better. Certainly not mine though.