Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are a ton of times in C++ or any language where you want the type. If having the type makes the code more readable, you should have it.


This is what everyone is saying. The only question is whether to ever use auto in non-generic code. I think it is unarguable that if you can write foo(goo()) in a clean way you can equally use auto. And if you can't do the former, you probably can't do the latter.

Balance, proportion, judgment, and code reviews are how you get great code, not 'never' and 'always' rules (which your comment makes clear you agree with).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: