I am so shocked at how many people use `auto` in C++. I can not think of a worse thing to do to your code in terms of readability and future maintainability. Maybe it is OK if you use an IDE to identify types for you but I still hate it. I am trying to learn a new library right now with light documentation which means reading the code, and between typedefs, auto, and technical debt, it is a tedious exercise to figure out something's type, to go look up its function, to see what type that is returning.
See c#:<p>"A discard communicates intent to the compiler and others that read your code: You intended to ignore it.<p>You indicate that a variable is a discard by assigning it the underscore (_) as its name."<p><a href="https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/discards" rel="nofollow">https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals...</a><p>2020: <a href="http://dontcodetired.com/blog/post/Variables-We-Dont-Need-No-Stinking-Variables-C-Discards" rel="nofollow">http://dontcodetired.com/blog/post/Variables-We-Dont-Need-No...</a>
"In addition, there are some variables such as locks and scope_guards that are only used for their side effects"<p>...<p>"This solution is also similar to other languages’ features or conventions"<p>As far as I know, in Rust you can't use "_" for that, as the value will be dropped right away, so the mutex/resource/etc. won't live for the scope.
<a href="https://www.london-fire.gov.uk/media/2045/london-frie-brigade-carers-hoarding_template_landing-page-panels.jpg" rel="nofollow">https://www.london-fire.gov.uk/media/2045/london-frie-brigad...</a> C++