There's more than one way to do it

From Wikipedia, the free encyclopedia
Jump to: navigation, search

There's more than one way to do it (TMTOWTDI or TIMTOWTDI, pronounced “Tim Toady”) is a Perl programming 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”).[1]

[edit] References

  1. ^ "Can EPO (or TPF) tame TIMTOWTDI?". dev411.com. 2009-01-24. 

[edit] External links