3 ms·
Conversely, once in about 6 months people call me to debug a "strange crash" and it turns out it's because they used a c-style cast, when using static_cast woul
by olvy0 5y ago
Conversely, once in about 6 months people call me to debug a "strange crash" and it turns out it's because they used a c-style cast, when using static_cast would have resulted in a clear compiler error.
To be clear, this is in a code written by people who are not exactly professional programmers, but rather a mix between support/integration personnel. They are responsible however for some rather basic glue code which I pull from them.
They are an interesting mix between real old timers who only know C well, and young people who only learned about Java and Python, with only a minimal background in C. Both of groups sort of "feel their way" around C++ code. Luckily I catch most of their mistakes during code reviews.
I try to educate them every time that they should use static_cast. Yes, I say, it's ugly and hard to type, that's true. But you will get an error during compilation, and you won't crash, and I won't have to go to your computer to debug your crash.