There is more than one way to do it
Encyclopedia
There's more than one way to do it (TMTOWTDI or TIMTOWTDI, pronounced “Tim Toady”) is a Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

 motto. The language was designed with this idea in mind, in that it “doesn't try to tell the programmer how to program.” This makes it easy to write extremely messy programs, but, as proponents of this motto argue, it also makes it easy to write concise statements like

print if 1..3 or /match/

or the more traditional

if(1..3 || /match/) {print}

or even the more verbose:


use English;
if( $INPUT_LINE_NUMBER >= 1 and $INPUT_LINE_NUMBER <= 3 or $ARG =~ m/match/ )
{ print $ARG; }


This motto has been very much discussed in the Perl community, and eventually extended to There’s more than one way to do it, but sometimes consistency is not a bad thing either (TIMTOWTDIBSCINABTE, pronounced “Tim Toady Bicarbonate”).

Notably, the Zen of Python has a motto that gives TIMTOWTDI a tip of the hat: “There should be one – and preferably only one – obvious way to do it.” This encourages doing things the best way available, with secondary alternatives if use cases require them. Its purpose is to make the language easy to learn and especially easier to read, because when there are many different ways to do the same thing, to understand existing code one has to know them all.

External links

  • Perl, the first postmodern computer language by Larry Wall
    Larry Wall
    Larry Wall is a programmer and author, most widely known for his creation of the Perl programming language in 1987.-Education:Wall earned his bachelor's degree from Seattle Pacific University in 1976....

  • There Is More Than One Way To Do It on the WikiWikiWeb
    WikiWikiWeb
    WikiWikiWeb is a term that has been used to refer to four things: the first wiki, or user-editable website, launched on 25 March 1995 by Ward Cunningham as part of the Portland Pattern Repository ; the Perl-based application that was used to run it, also developed by Cunningham, which was the first...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK