Yike Lu
Finder of biased coins.
- Joined
- 5/10/10
- Messages
- 772
- Points
- 53
I've had some arguments about this point.
C++ specifically has the issue that it is so big with so many styles that it can be hard to understand. Suppose for example you are an beginning/intermediate C++ programmer thrown into the fire and asked to debug some legacy code. With C++, you could be dealing with any of the following
1. Advanced OOP code and corner cases like eg multiple inheritance
2. Advanced template programming (templates being almost Turing complete themselves).
3. FP (??? not sure on this myself as far as C++11).
4. Pointers.
5. Hand built GC.
6. Bad multithreading (especially when combined with pointer issues and exception handling).
Or from another perspective, all these features make it easy to write really messy code. See Linus's point here... http://article.gmane.org/gmane.comp.version-control.git/57918 (note, not saying I fully agree, but I was having an argument around this point).
My friend's counter-argument is that, given that C++ is like C with more stuff, it should be considered strictly better. So the tension here is really between the design for the beginning C++ programmer and the expert. I agree with him as far as C vs C++.
Actually my personal experience here is that even without these types of issues (ie, you inherited relatively clean code and can write it yourself), C++ has an awfully large amount of boilerplate. Note for comparison, I'd say that Python has a medium level of boilerplate, and say Lisp (the various kinds) and q have low boilerplate. Meaning you have to do ABCDEF to get to G instead of maybe just EF. That of course is also a strike against C. Really, this is what kills it for me when it comes to everyday tasks.
As for suitability, Python would be suitable for PDE and MC control code and HFT operations/research work. It just isn't suitable for core algorithms (and I don't think you'd get any argument there form any of us).
C++ specifically has the issue that it is so big with so many styles that it can be hard to understand. Suppose for example you are an beginning/intermediate C++ programmer thrown into the fire and asked to debug some legacy code. With C++, you could be dealing with any of the following
1. Advanced OOP code and corner cases like eg multiple inheritance
2. Advanced template programming (templates being almost Turing complete themselves).
3. FP (??? not sure on this myself as far as C++11).
4. Pointers.
5. Hand built GC.
6. Bad multithreading (especially when combined with pointer issues and exception handling).
Or from another perspective, all these features make it easy to write really messy code. See Linus's point here... http://article.gmane.org/gmane.comp.version-control.git/57918 (note, not saying I fully agree, but I was having an argument around this point).
My friend's counter-argument is that, given that C++ is like C with more stuff, it should be considered strictly better. So the tension here is really between the design for the beginning C++ programmer and the expert. I agree with him as far as C vs C++.
Actually my personal experience here is that even without these types of issues (ie, you inherited relatively clean code and can write it yourself), C++ has an awfully large amount of boilerplate. Note for comparison, I'd say that Python has a medium level of boilerplate, and say Lisp (the various kinds) and q have low boilerplate. Meaning you have to do ABCDEF to get to G instead of maybe just EF. That of course is also a strike against C. Really, this is what kills it for me when it comes to everyday tasks.
As for suitability, Python would be suitable for PDE and MC control code and HFT operations/research work. It just isn't suitable for core algorithms (and I don't think you'd get any argument there form any of us).