-
Notifications
You must be signed in to change notification settings - Fork 197
Stop using C-style casts in new code #3010
Copy link
Copy link
Open
Labels
Description
There are several places in our codebase where we are relying on C-style casts instead of using C++ casts. While it's true that writing something like float(value) is shorter and arguably more readable than something like static_cast<float>(value), C-style casts are inherently a worse choice. In particular, there are three benefits of using C++ style casts:
- they're checked at compile time by the compiler (when it's possible to do so).
- they express intent much better than C-style casts.
- they're greppable (very useful when refactoring something).
Reactions are currently unavailable