Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Referring to the three-way “FORTRAN” syntax, you say, “The three-way "if" was more powerful than just checking for a negative, but was probably more confusing,” this is not right. As a 15-year-old at Stuyvesant, in 1966, learning FORTRAN 4, I assure you it was the most natural thing in the world. Especially instructive was the fact that usually two of the target statement numbers would be the same. FORTRAN 4 didn’t have Boolean data types, OR, or AND and += was still in someone’s nightmare.

Note also that when Microsoft put IF( , , , ) into Excel, the most widely used computing application in the world, they essentially used this syntax.



Thanks. It has been cited as confusing in sources like The Elements of Programming Style, but I can appreciate that it may feel natural to some people, and there are certainly cases like strcmp() where a three-way distinction is necessary, and current languages lack a good way to talk about it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: