[ prog / sol / mona ]

prog


Marvin Minsky - The Beauty of the Lisp Language [Part 2]

21 2020-10-15 05:25

Notice one of the only things a fanatical C programmer will defend C with is popularity. The C programmer is generally unable to point to any particular design decision as beautiful. Is it beautiful, to be able to interleave control structures in nonsensical ways even other C programmers may not recognize as valid, with Duff's device being an example?

Is Pigeon's Device beautiful:

int pigeons_device(int a, int b, int mode) {
    int result;

/* Isn't C a wonderful language? */
    switch (mode) {
    case 0: if (gloop(a, b)) {
    case 1:     result = arfle(a, b);
                break;
            } else {
    case 2:     result = barfle(a, b);
                break;
            }
    }
    return (result);
}

What does anyone possibly gain from being able to write such a monstrosity? Lisp, owing to its list structure, doesn't permit this kind of vile shit. There's no gain from this. It makes everything more complicated, confuses the programmers, and benefits nothing whatsoever, but the defensive C programmer will just shrug it off as a quirk or footgun and let that be the end of it. Then, certain C programmers will have the gall to call Lisp ugly for well-documented behaviour they simply don't care for.

Is array decay beautiful? Is the decision to trade O(1) space and O(1) time in string length operations for O(1) space and O(N) time, with null terminators beautiful? Is associativity in array indexing beautiful? There's absolutely nothing the C programmer can point to as beautiful, but he'll point to millions of lines of code he had naught to do with and will likely never so much as try to read, and pretend that matters. It's an affront to good design that operating systems and other programs are so large. I'll end it with this.

24


VIP:

do not edit these