How to write good code with C++11
31–34 of 34 posts
Re: How to write good code with C++11
#32Re: How to write good code with C++11
#33Earlier quoted context omitted.
>Each layer of convenience has a penalty. That's only true if you can beat the layer implementation, and frankly I don't know any programmers (including myself) that would beat a optimizing compiler in code generation. >It's not like software (especially games) is static, so that the managed/native gap will get insignificantly imperceptible at some point. Here you go : http://deltaengine.net/ - used in this game : ht…
That's only true if you can beat the layer, and frankly I don't know any programmers (including myself) that would beat a optimizing compiler in code generation. We're not talking writing assembly vs having the compiler do it, here. We're talking using a high level language with features such as garbage collection, bounds checking etc, versus not. Those kinds of layers are both expensive AND beatable, regardless of t…
No - those layers were invented because those things were such common errors - ie. - most people got them wrong. So nope, most people aren't able to beat those in everyday code, and debugging is expensive. Performance is not the only metric, even in games, and you have to "beat" the other metrics as well - such as bug count/correctness and productivity. Maybe when you have AAA titles and can budget a few millions on dev team alone the equation looks different, and that's why I singled them out. But for small teams (mobile) and indies/amateurs .NET is good enough (and is being used).
And games regularly sacrifice performance for productivity, look up early unreal script (interpreted), and how it was often the bottle neck but was still used in development.
Re: How to write good code with C++11
#34Earlier quoted context omitted.
I personally enjoyed reading the FQA, and even learned about some C++ "subtleties" in the process. I note however that the FQA itself has its share of criticism. http://stackoverflow.com/questions/3171647/errors-in-c-fqa
When reading this rebuttal, keep in mind that it was written in 2010 while the FQA was written starting in 2007, and apparently based on the author's experiences with much older tools. All other things aside, if your compiler frequently miscompiles templates, using them is probably not a good idea.
Also, I still agree with the basic premise of the FQA: for the majority of new projects where C++ is used, C++ is not the best tool for the job (not taking into account programmer expertise, though even then…).