|
|
|
|
|
by ldar15
5305 days ago
|
|
In Systems Programming Languages? For "writing operating systems"? There are people who argue we should be writing our operating systems in high level languages anyway. Assuming the premise is we should be using a low-level language, then how does the author reconcile that with "but I want the language to hold my hand when it comes to math". Choosing "overflow" or "underflow" to mean "I fucked up" is totally arbitrary. Variables usually indicate values that have a domain - a range of valid numbers. Saying "I don't want to think about what that it is, but oh if X hits 2 billion and change then warn me when some math fails" is no better than having it not fail at all. In most cases there's already a problem. So, simply, writing "OS quality" code means explicitly checking inputs to ensure they are in the permissible range. Once you know what the range is, you know if your code needs to go up to 64bit math to handle them. UPDATE: Some explanation for the downvote would be appreciated. |
|