Simon Willison’s Weblog

Subscribe

Friday, 23rd May 2003

Programming by Contract in Python

Programming by Contract seems to be a sister technique to unit testing—instead of (or as well as) writing a set of tests for a piece of code you write a set of pre- and post-conditions for the data being processed which are then checked whenever the program is run in debugging mode. Contracts for Python discusses the technique, providing a reference implementation and a PEP suggesting inclusion of support for the technique in the core language. Programming by contract was first demonstrated in the Eiffel language, and there’s a good introduction to it in Eiffel.com as well.

Even more buttons

If the 309 buttons at Steal these buttons aren’t enough for you, you can now generate your own thanks to a clever PHP script on Minimal Verbosity. Bill Zeller has made the source code available as well.

Learning Python, second edition

Mark Lutz has announced that he is working on a second edition of Learning Python. The first edition of Learning Python is probably the best learn-programming-language-X title I have ever read. It’s nice and short, but covers the whole core Python language comprehensively with excellent examples and a well targetted learning curve. I’ve lent my copy to several people, all of whom found it very helpful and one of whom went on to buy a copy themselves. I’ll probably be buying a copy of the second edition just so I can use it on my constant mission to get more people on my course to give Python a go.

Browser bug swatting

Craig Saila: Browser bug swatting:

[... 128 words]

CSS Tutorial: feedback so far

My CSS tutorial series has been getting some fantastic feedback, both in this blog’s comments system and elsewhere. This entry will summarise the most useful feedback, acting as a kind of errata to the previous entries. Thanks to everyone who commented, there are too many to credit individually but you can see most of the points in their original format by browsing the comments attached to each entry.

[... 661 words]

2003 » May

MTWTFSS
   1234
567891011
12131415161718
19202122232425
262728293031