3 ms·
> Anyone know the language design rationale behind the way Java does it? Because C did it, because Algol did it, because Fortran did it, because that is how as
by sedachv 7y ago
> Anyone know the language design rationale behind the way Java does it?
Because C did it, because Algol did it, because Fortran did it, because that is how assembly code works. Expressions require code to be compiled to something that uses a temporary value stack (or equivalent, like what some continuation-passing style compilers do by allocating values from garbage-collected memory), which, along with subroutines, was an exotic technology well into the 1960s.
- verandacoffee 7y agoAlgol (60) had if-expressions, as did Simula 67 (based on Algol): x := if (y = 0) then 0 else 4 / y