Remix.run Logo
ahartmetz 3 hours ago

The kind of programmer who don't check (or think through so that they can't fail) their map lookups is also the kind of programmer who don't bother with const. What a non-const unchecked map lookup gives you is a default-constructed value that has just been inserted for the only reason that operator[] returns a reference, which must "point" to something. That's bad and can be confusing, but it doesn't crash.

I see that problem much more often than crashes due to unchecked map lookups in production, which are very rare for me. Less than once a year.