TIMTOWTDI

@thomasguest

wordaligned.org

There is more than one way to do it

“Tsall good”

Perl, the first postmodern computer language — Larry Wall, 1999

ZOP

TSBO-APOO-OWTDI

Zen of Python

  1. There should be one—and preferably only one—obvious way to do it.
  2. Although that way may not be obvious at first unless you're Dutch.

TIMTOP

There is more than one Python

Python 2

Python 3

PyPy

Jupyter

TIMTOPOM

There is more than one Program Options module

getopt

optparse

argparse

Users who are unfamiliar with the C getopt() function or who would like to write less code and get better help and error messages should consider using the argparse module instead.

TIMTOUTF

There is more than one Unit Testing framework

unittest

doctest

pytest

etc...

The unittest unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages.

TIMTOWOFS

There is more than one way of formatting strings

"double" or 'single' quotes

"""triple""" quotes

r'raw'

R"""ROAR!!!"""

who, what = 'Thomas', 'noodles'
s = '%s likes %s' % (who, what)
t = string.Template('$who likes $what')
s = t.substitute(locals())
s = '{} likes {}'.format(who, what)
s = f'{who} likes {what}'

Don’t Do It This Way

>>> Ω = 'There is more than one way to do it'
>>> f'''\
{   """"""
.   join(ω[0]
.   upper() 
for ω in Ω.split())}\
'''
'TIMTOWTDI'
How many times have we heard the mantra that a program should do one thing and do it well?

If all you have is a hammer, everything starts to look like a nail.

If all you have is duct tape, everything starts to look like a duct.

When’s the last time you used duct tape on a duct?

THANKYOU

@thomasguest

wordaligned.org