logoalt Hacker News

jb1991yesterday at 8:03 AM2 repliesview on HN

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.


Replies

1718627440yesterday at 10:48 AM

As a C developer to me uninitialized variables are a feature and I love to invoke UB with __builtin_unreachable, because it makes the compiler able to actually bark at me on incorrect usage instead of it silently working.

adrianNyesterday at 9:33 AM

Automatic conversion between numeric types is also a fun source of bugs.