Static typing makes using generic containers a pain in the butt, due to the need of upcasting. So one tries to fix it by using STL template based containers. But then you switch to Generic programming and getting it to work with your OO designed program is asking for trouble. Say you got a scene graph type of structure, consisting of Shape objects. Shape use a composite pattern. LayeredShape and GroupShape inherit Shape. Each store shape objects in different data structures. You want to provide access to all sub shapes in the composites. The natural choice would be to use an iterator. Except you can't expose STL type iterators because those are type specific to the container type. E.g. a vector<int>::iterator is of a different type from list<int>::iterator. Now this works fine for Generic programming because you are not programming against interfaces like in OOP. But it makes it impossible to define a virtual iterator accessor in the Shape class. This is just one example, but I find it to be a annoying and extremely reoccuring problem that concepts from STL and generic progarmming simply don't fitt in with OOP. On large applications I find that you essentially end up reimplementing the features of a more dynamic OO language in a non standard and buggy way on C++. Please not I am not saying C++ is a bad language. It is extremely powerfull for creating algorithms and template programming is extremely powerfull. But as an OO language it is extremely cumbersome to use. One ends up reinventing too much concepts from other languages.
I took 2 years of c++ programming in my school, and I wish there was another programming course I could of taken, but c++ was the only available one. I honestly probably won't use it again, but I am going into the computer field for college, so it will probably be good just to say I know c++
Don't you assume I already know that ... my point was that Plain C is more efficient than C++ ... with C you just basically work with functions http://nothings.org/computer/cpp.html this FAQ page is by the inventor of C++: http://www.research.att.com/~bs/bs_faq.html
Well said.. If you want an OO language use a language designed as OO. C is very powerful but sucks for use as a OOP
That was hilarious... That was the reason for C++, because of "sphagetti code" which was present in C and thanks to OOP we don't have that...
The newer languages (Java, C#) are *more* object oriented than C++ because basically you are only dealing with classes communicating and utilizing other classes... HOWEVER this was only possible because of C++, while it wasn't the first OOP language (Pascal preceded it), later in it's development it was utilized more and more like how Java and C# operate today.... which was actually what lead to the development of Java, and then later on C#.