3 ms·
It's a perfectly reasonable niche use case for achieving maximum performance. My main issues with it are: 1. Like many other performance optimizations, it is
by adrianmonk 8y ago
It's a perfectly reasonable niche use case for achieving maximum performance.
My main issues with it are:
1. Like many other performance optimizations, it is a trade-off. You may be sacrificing easy maintenance or even introducing breakage (if the person using it doesn't understand the limitations and implications). So IMHO you should only do it if you can show through profiling, etc. that the gain is real and worth it.
2. As a matter of language ergonomics, it should never be something that anyone does unknowingly. You should have to explicitly ask for it. The type name should be something blindingly obviously like "native_int" or "word_int".
- dcow 8y agoEven Swift who’s mantra is do nothing unexpected or implicit has a machine dependent (word sized) Int type.
- the_clarence 8y agoThat’s insane
- the_clarence 8y agoYou’re trading off security here. Users are going to shoot themselves in the foot assuming that int is this size or this size.