Hacker News new | ask | show | jobs
by gpderetta 2284 days ago
> C has a very weak type system, which is static. There's a lot of implicit conversion going on. Also the expressiveness of the type system is very limited (in C++ also).

It is true that the subset that C++ shares to C has too many implicit conversions, but you can do much better.

For example in C++ you can use enum class to define strongly typed integrals that do not implicitly convert to the basic types.

1 comments

Enum classes are a good first step, but C++ is still very relaxed on integer and float conversions.

I just wish I could use rust or ADA at work.