Macros are a powerful language feature, but some languages (eg, Java) explicitly leave them out because of their social cost (balkanizing dialects, and too much rope for the clueless to create horrors).
In comparing Perl and Python, one observation which gets made is that Perl's rich hairiness provides useful power and avoids "you can't get there from here" problems which one sometimes encounters in Python, especially when doing DSLs. But Python's restrictions provide a minimum floor on bad taste, which much Perl code plumbs deeply.
Now, Java tools have developed for further restricting programming style. Style checkers on steroids. This or that syntactic or semantic construct can or can't be used in this or that situation.
So one might imagine creating a Perl style analyzer, and defining a "good taste Perl style" which one should default to when there isn't a reason not to. This has happened socially to some limited extent. I suspect it hasn't yet happened more, more for cultural rather than for technical reasons. Or perhaps simply no one has yet gotten around to it.
Which raises the language design question. Is one better off creating a language which restricts abuse and use, or creating a language in which anything goes, and then defining culturally-acceptable testable subsets for everyday use?
|