logoalt Hacker News

account42today at 9:36 AM0 repliesview on HN

> The auto keyword is also considered a code smell for the same reason: just because the compiler can tell exactly what the type is expected to be, that does not mean the developer can. Therefore it makes the code harder to reason about.

This really depends though. In many cases even the programmer can tell the type of auto because its on the very same line and not using auto would mean needlessly repeating it.

In other cases (e.g. iterators) the programmer also doesn't need to care about the concrete type.