Lots and lots of things are bad in C++. But that's because it's an elaborate language with lots of things in it. You only have to use one bad thing at a time ;-).
Basically, any language with lots of modularity and lots of low level access is going to be big and have lots of features that are problematic in some situations.
Say you need both modularity and low level access in a given program. Can they be so entangled that you absolutely have to put both in the same language?
No matter how I put it, I fail to see how C++ can be better than C + (Python or Lua or Haskell, with FFI). Is the concept of using 2 languages at the same time so scary?
"Say you need both modularity and low level access in a given program.
Can they be so entangled that you absolutely have to put both in the
same language?"
That's not always an option if you've performance and memory constrains.
We're using Python only for high level scripting purposes.
If you've a performance critical function, where few data goes in,
long computation and few data out, then it's perfect to implement
this function in C and have a python function calling it.
But if you've a lot of data, then that's not an option. You just can't
copy all the data to C and then after computation back to python,
it will kill the performance gained by the C function implementation.
But also if you're trying to do complex operations on your application
object hierarchy, Python will kill your performance. Only compare
the time for a member/property access in Python and C++.
Is the concept of using 2 languages at the same time so scary?
In all honesty, yes.
But consider this also. The advantage of C++, such as it is, is that the big, harry objects you are creating can call each with just about any calling conventions you chose and you can parameterize them at run time and compile time in whatever crazy way you'd like (pointers, templates, static objects, classes and ponies! (Ponies will only be standardized in C++_2015)). This is why Python, Lua and all each call c/c++ for extensions. But while there are many interesting scripting languages out there, there's no guarantee that any of these languages' calling convention, memory usage and constraints will be what your large objects need. Specifically, to effectively use a particular higher-level language you'd have to know from the beginning that said language's conventions would satisfy your needs from beginning to end.
Add to this the fact that C++ may not be a "good" programming language but that it's not that bad if used with discipline and understanding. The badness of c++ comes from the many, many ways you can shoot yourself in the foot - it still doesn't force to do anything. But how many subtle bugs can creep in if you're sloppy in passing raw pointers to some other language? And using any higher level language will involve forcing yourself to do a number of things that could prove problematic.
| Is the concept of using 2 languages at the same time so
| scary?
Yes, but it seems to be inevitable. Python + C. Haskell + C would be my choices for large scale modeling/data analysis. For apps involving a GUI, I would like to hear others thoughts.
Basically, any language with lots of modularity and lots of low level access is going to be big and have lots of features that are problematic in some situations.
Basically, any language with lots of modularity and lots of low level access is going to be big and have lots of features that are problematic in some situations.