Hot answers tagged

17

The designers of the Fortress Programming Language did extensive reviews of scientific literature to see how operators are used and what relative precedence they have. Based on those observations, they designed operator precedence in Fortress. This is the only instance I know of where a Programming Language Designer has explicitly written down their ...


10

There isn't some grand logical scheme, especially in C and the derivatives that kept its order. It's basically a combination of "this feels right" and historical accident. Obviously, you want to keep the precedence of arithmetic operations that you learned in school: * and / before + and -. All the number manipulation should be somewhere in that area. (...


4

Doubles take twice more space. On some devices and for some applications this makes a difference. Think of 3D graphics: lots of numbers and no need for super-accurate results. Also, financial transactions use integers (think dollars and cents) because they need not just accuracy, but exactness.


2

Usually the behavior for wrong login is pretty well defined and specified so strictly speaking, again I verify described behavior. In well-written software, ideally there should be no user-facing undefined behavior - in practice it is not possible to eliminate it completely (you cannot predict or control everything that could lead to it), but you do your ...


Only top voted, non community-wiki answers of a minimum length are eligible