|
|
|
|
|
by Elv13
4095 days ago
|
|
> inefficient abstracted programming models where two years down the road
> you notice that some abstraction wasn't very efficient, but now all
> your code depends on all the nice object models around it, and you
> cannot fix it without rewriting your app. The opposite can also be said. By re-inventing a simple data structure, you can end up 2 years later in the same position where your structure is inefficient (list vs. array, etc) and you end up having to rewrite your app. While implicit operator overload was probably a C++ mistake, it does allow to replace some kind of structures with other one without changing the code relying on them. Other than that, I kind of agree that C++ is kind of terrible. So is perl, php, js or any other languages that send a barrage of features to the programmer without managing to educate them on their impact on performance and memory structure. Most C++ devs know about vTables and that's about it. I would also argue that C isn't a very good language either. It may be simpler to "get" what actually happen when you run your code, but has sub par code organization, total lack of "pointer flow" tracking, causing huge security traps and has an evil reliance on casting for any kind of structure/callback abstraction. All of those things could be "fixed" in new languages, but beside Rust, it seem there is no leverage for proper system level languages these days. OOP is probably a better choice for business programming anyway, but that's not even half of the market. |
|
are you talking about the implicit conversion operator or operator overloading in C++?
For the former, it has been vastly improved in C++11 with the addition of explicit conversion operator. For the later, some very important capabilities of C++ rely on operator overloading namely the assignment operator (copy/move assignment) and the function operator (allows what C++ calls functors). Another useful thing with operator overloading is allowing the creation of generic functions that work on existing types (int, float, ..) and user defined types, for example std::accumulate.