September 26th, 2010, 7:55 pm
Garbage collection is overrated and has nothing to do with debugging. It helps only with memory leaks, which is not a big problem anyway. In C++ automatic garbage collection can be delegated to smart pointers and allocation/deallocations to library containers. You can avoid explicit memory management, if you want. For example, QuantLib has about 100K lines of code and 0 delete operators. Consider pointers and explicit memory management as a bonus, not a burden.In Java/C# everything except POD (plain old data: int, double, char, etc) is handled by reference, something similar to smart_ptr. I have a feeling, that it can be a scalability bottleneck in multicore environment. In reality, garbage collection could be a liability, not an advantage.Regarding multithreading. OpenMP is very easy to use and supported on all major platforms. TBB is fancier, but more flexible then OpenMP. IMHO, TBB is better then Java's concurrency. C# 2010 has improved support for parallel programming. But multithreading takes you closer to hardware, which inevitably leads back to C/C++.C++ is richer and more expressive then Java/C#. If you want to master all of it, the learning curve can be very steep. But if you stick to 80/20 rule (80% of time you need only 20% of features), the learning curve similar to that of Java/C#.