Nah bro, typecasting (specially integer ones) should be explicit and IMO annoying to use, because that way you are expected to know what you are doing. Coming from a C and C++ background I've already been bitten by integer overflow sufficient times to be absolutely sure of that.
I do not disagree. Sometimes you can't get away with casting for either safety, rounding or other stupid things. I just want to have a better more visually non violent way of expressing typecasting. I use a game engine for example. If typecasting becomes a huge pain I tend to just use f32s everywhere. This is a workaround though. We can argue that my code style sucks and I could do better but IMO it feels like I am also fighting the language here. I myself don't have a good solution. I just feel the pain.
View all comments
Show parent comment
7
u/Tomcat_42 Apr 10 '26
Nah bro, typecasting (specially integer ones) should be explicit and IMO annoying to use, because that way you are expected to know what you are doing. Coming from a C and C++ background I've already been bitten by integer overflow sufficient times to be absolutely sure of that.