3 ms·
What he is pointing out is that C++ makes it harder to 'know the code you are working with'.
by uriel 17y ago
What he is pointing out is that C++ makes it harder to 'know the code you are working with'.
- ubernostrum 17y agoFWIW, I think you meant to say "what she is pointing out"...
- huhtenberg 17y agoI understand the point, and I am saying it is a trivial one. Calling func(x) in C may as well be causing x to be cloned or have some other nasty side effects that are not immediately obvious from looking at the code. Similarly how one should always keep in mind the existence of macros when reading C code, one should also keep in mind the existence of constructors and casting operators with C++. That's hardly the hidden cost. It is easier to write messy or obscure code in C++, especially for a novice programmer. But this has less to do with the language per se and more with established coding practices within specific team. If there is a hidden cost to C++, it is the fact that it requires higher level of competence. Not that it has constructors.
- groby_b 17y agoThe point is that, with a rational team, I can tell (roughly) what a function is doing, based on the name. It's not going to be called 'dot_product' and clone data passed in ;) What I can't tell is how much extra code the compiler will generate at this point, and that is the problem. > If there is a hidden cost to C++, it is the fact that it requires higher level of competence. Not that it has constructors. I didn't say the cost is in the constructors. They're a symptom of the cost. The cost is creating the mental model of your app. Sure, if the entire team consisted of C++ superstars, we might be able to get away with this. Given the team size on current games, (and the fact that superstars are rare) that's unlikely to be the case.
- nuserame 17y agoIf there's no enough "superstars", then perhaps your coding guidelines should accommodate that so that the "mental model" of the app would be more managaeble for the code monkeys.
- groby_b 17y agoThis is not a question of "code monkeys". It's simply a question of having some programmers that are less experienced than others. And that's kind of unavoidable if you ever want to hire new people...