Node:The Slogans,
Previous:Perl as a Natural Language,
Up:Background of Perl
The Slogans
Clearly, Perl is a unique language. This uniqueness has brought forth a
community and an ideology that is unprecedented with other languages. One
does not have to be a member of this community or agree with this ideology
to use Perl, but it helps to at least understand the ideology to get the
most out of Perl.
The common Perl slogans have become somewhat famous. These slogans make
up the "Perl ethic"--the concepts that guide the way Perl itself is
built, and the way most Perl programs are written.
"There's more than one way to do it". This slogan, often abbreviated
TMTOWTDI (pronounced TIM-toady), is common among many
programmers, but Perl takes this idea to its logical conclusion. Perl
is rich with non-orthogonality and shortcuts. Most major syntactic
constructs in Perl have two or three exact equivalents. This can be
confusing to newcomers, but if you try to embrace this diversity rather
than be frustrated by it, having "more than one way to do it" can be
fun.
"The Swiss Army chain-saw". This is the somewhat "less friendly"
summary of the previous term. Sometimes, all these diverse, powerful
features of Perl make it appear that there are too many tools that are
too powerful to be useful all together on one "Swiss Army knife".
However, eventually, most Perl users find all these different
"chain-saw"-style tools on one "Swiss Army" knife are a help rather
than a hindrance.
"Perl makes easy jobs easy, and the hard jobs possible." This is a
newer phrase in the Perl community, although it was originated by Alan
Kay decades ago, but it is quite valid. Most easy tasks are very
straightforward in Perl. As the saying goes, most programmers find that
there are very few jobs that Perl cannot handle well. However, despite
what the saying might indicate, Perl is not a panacea; the programmer
should always choose the right tool for the job, and that right tool may
not always be Perl.
"Perl promotes laziness, impatience and hubris." These seem like strange
qualities to be promoting, but upon further analysis, it becomes clear why
they are important.
Lazy programmers do not like to write the same code more than once.
Thus, a lazy programmer is much more likely to write code to be reusable
and as applicable in as many situations as possible.
Laziness fits well with impatience. Impatient programmers do not like
to do things that they know very well the computer could do for them.
Thus, impatient programmers (who are also lazy) will write programs to
do things that they do not want to have to do themselves. This makes
these programs more usable for more tasks.
Finally, laziness and impatience are insufficient without hubris. If
programmers have hubris, they are much less likely to write unreadable
code. A good bit of hubris is useful--it makes programmers want to
write code that they can show off to friends. Thus, hubris, when
practiced in the conjunction with laziness and impatience, causes
programmers to write reusable, complete and readable code. In other
words, it is possible to exploit these three "bad" traits to obtain a
"good" outcome.
|