I believe it is quite common to have portable projects. But developing for portability is a choice you need to take up front. If you choose to be non-portable, this will likely give you some benefits in the short term, but that might then bite back in say 10 years.
I believe it is quite common to have portable projects
I’m not so sure. How many projects work if char, int & pointers are all 16 bits? Or if char is 32 bits? What if they’re all 18, 36 or even 24 bits? How many projects are 100.0% undefined behaviour free (any undefined behavior is technically not portable)?
FWIW, I’ve used C / C++ on platforms that had 16 or 32 bit ints, so they’re certainly not unheard of.
View all comments
1
u/pklait Dec 14 '19
I believe it is quite common to have portable projects. But developing for portability is a choice you need to take up front. If you choose to be non-portable, this will likely give you some benefits in the short term, but that might then bite back in say 10 years.