Orthogonality
A long tract on several aspects of programming language design, tied together (sometimes somewhat loosely) by the concept of “orthogonality”.
Frank Carver's musings about software and life
A long tract on several aspects of programming language design, tied together (sometimes somewhat loosely) by the concept of “orthogonality”.
Steve wrote:
He reckons that Pascal/Delphi’s semicolon parsing doesn’t act consistently when composed within a surrounding statement. But the code he complains about isn’t within a surrounding statement – it is part of (not within) the statement. Let’s look at the Java equivalent:
public static void main (String[] s) {
if (true) System.out.println(“true”);
else System.out.println(“not true”);
}
Suddenly, outside of any statement, an “else” just jumps into being! He says this is now more “orthogonal”. So I should be able to remove the “if”, making
public static void main (String[] s) {
//if (true) System.out.println(“true”);
else System.out.println(“not true”);
}
which is nonsense, of course. I think Niklaus Wirth thought hard before going the way he did. The remarks on VB are right, though – and Java has its problems too.
Posted on 20-Aug-08 at 2:37 pm | Permalink