4 ms·
I specifically referred to C++11. And I believe your example with the T{val} is C++14 so I don't know much about it. My experience is working on video game eng
by forrestthewoods 12y ago
I specifically referred to C++11. And I believe your example with the T{val} is C++14 so I don't know much about it.
My experience is working on video game engines with other people. As a senior developer a large part of my job is jumping through a wide range of systems written by other people to debug problems, identify ways to increase performance, add features, etc. There's also a lot of code written by people who have moved on to other jobs.
We've had quite a bit of code that was full of autos. In my experience thus far auto has never made code more significantly readable or easier to understand than not using auto. (excluding iterators/lambdas) Not only has auto not made code easier to comprehend the use of auto has made it significantly more difficult to understand on more than a few contexts. If deducing a type as a human reader of text requires backtracing a half dozen calls of code across who knows how many lines of code, and even files, then I'm gonna be justifiably grumpy. It's a huge burden. And for what benefit? Damn near nothing in my experience so far.
- MrDosu 12y agoThis is something an IDE does for you...
- forrestthewoods 12y agoIn theory, but not in practice. Visual Studio starts off great but it eventually chokes and dies for C++. Tools like Visual Assist can extend the lifetime but eventually it too will fail. This is true for every game and every engine I've ever worked on. I now do 100% of code editing in Sublime Text. Other people use other text editors. I'm now of the opinion that code bases should be useable and searchable in plaintext form. It's not difficult and even with an IDE makes things better imo.
- MrDosu 12y agoI would (almost) completely disagree with this. C++ support in VS is horrible, that's correct, but having the ability to be supported by compiler services that can parse (invalid) code is a major milestone when it comes to handling more complex codebases. It does not matter how smart you are, the easier it is for you to understand and reason about the code, the more will fit in your head. Refactoring is just one of the many amazing tools that make me a much better and more productive programmer today then I was without when using vi in the 90s. Add in static analysis, intellisense etc... Every bit of complexity that tooling can hide from you is worth gold. Reality for C++ is grim though in this regard. Let's hope we get better compiler services for it soon.
- forrestthewoods 12y agoI agree that the easier it is to understand and reason about code the better. That's why I'm opposed to most uses of auto. It makes code harder to understand. It might not make code harder to understand if it was used with tools that doesn't exist. But those tools don't exist. I'm constantly re-evaluating my opinions and for auto I keep reaching the same conclusion. I pray that someday new tools are released that make my work life better. When they are some of my re-evaluations, related to auto or otherwise, will certainly change. But sadly that day is not today.
- MrDosu 12y agoJust interested: Do you use static analysis tools (like for example coverity) in the gamedev industry?
- fafner 12y ago> And I believe your example with the T{val} is C++14 so I don't know much about it. No, it's C++11.