(I'll drop into an aside here and complain. Why is it that Perl has begun to complain when I write something like this:
my $foo = '' ;
print "XXX" if $foo =~ m{xxx}mx ;
????
Seriously, if a string has nothing, it clearly will not have the string
xxx
in it. '' should no more pop up an error than 'aaa' should.)This chapter focuses on an implementation of a regular expression engine written by Rob Pike for the book The Practice of Programming. Chosen because it's a clear usage of recursion that isn't Quicksort or walking a tree. If I was Norm MacDonald, I'd note that programmers love recursion like Germans love David Hasselhoff. I suppose I might anyway.
But it's clear that Kernighan is fairly uncomfortable with the concept of beauty as applicable to computer science. He says "elegant" and "novel" and "compact". Those are three common metrics for beauty, but then, the standard of beauty would be Ingrid Bergman. She's beautiful, true, but hardly the only standard.
No comments:
Post a Comment