logoalt Hacker News

jandrewrogersyesterday at 6:56 AM1 replyview on HN

I knew the answer to most of these intuitively but the story isn’t great. Regardless of the programming language, I’ve always been an “auto” minimalist. There are relatively few contexts where relying on inference is justified by the expedience. Ignoring the issues raises by the article, explicitness simplifies things and reduces bugs.

That said, there are some contexts in which “auto” definitely improves the situation.


Replies

jb1991yesterday at 8:03 AM

You will typically find bugs go up when you do not use auto in most average C++ code bases because, as noted by another comment, a lot of C++ developers have the bad habit of writing uninitialized variables, which auto prevents.

show 2 replies