▲ | pratyahava 6 days ago | |||||||||||||||||||||||||||||||||||||||||||
was that assumption in C code really unnecessary? i suppose it made many things much easier. | ||||||||||||||||||||||||||||||||||||||||||||
▲ | kazinator 6 days ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||
In my experience, highly portable C is cleaner and easier to understand and maintain than C which riddles abstract logic with dependencies on the specific parameters of the abstract machine. Sometimes the latter is a win, but not if that is your default modus operandi. Another issue is that machine-specific code that assumes compiler and machine characteristics often has outright undefined behavior, not making distinctions between "this type is guaranteed to be 32 bits" and "this type is guaranteed to wrap around to a negative value" or "if we shift this value 32 bits or more, we get zero so we are okay" and such. There are programmers who are not stupid like this, but those are the ones who will tend to reach for portable coding. | ||||||||||||||||||||||||||||||||||||||||||||
|