2 ms·
If I were to speculate... I think you're really underestimating how limited hardware used to be. Firstly, portability of code was simply not as useful a featur
by da_chicken 3y ago
If I were to speculate... I think you're really underestimating how limited hardware used to be.
Firstly, portability of code was simply not as useful a feature. The big benefit was that the programmer could read and write code anywhere, not that the same code ran everywhere. Everything you could do with a computer was fundamentally hardware-dependent. If you needed to take your code and transfer it to another platform, you were going to have to deal with such a fundamentally different architecture that you already knew you'd have to rewrite it. Like storage wasn't even compatible. You didn't even know the width of a character, let alone the encoding for it. It could be 7 bits, 6 bits, 5 bits, whatever. RS232 communication might even be a struggle. C came about in 1972. The first widely available single chip UART was in 1971.
Second, hardware was simply not capable enough to dynamically handle a fixed size. If you wanted a 16 bit integer, your hardware might not be able to do operations on that at all. You might have 6 bit integers and everything else is a bitwise stream. If you want 16 bit math, maybe you've got to figure out how to do that 6 bits at a time yourself. Some of the hardware you were dealing with was microchips, not microcontrollers.
So you didn't do it because (a) it wasn't a concern for the programmer because portability wasn't really a thing in the same terms, and (b) it was outside the practical capabilities of the hardware.