Tim Hatch

Weblog | Photos | Projects | Panoramas | About

Programming Tidbits 08 Mar, 2006

Unit testing is so great I can’t live without it now. I find that the code I write in Python, tests-first, is generally higher quality than that I’ve been able to write in other languages, such as PHP, Java, and any-random-dot-net-language. I firmly believe that all non-trivial functions should have tests written as soon as the design is spec’d out, which is to say, generally before the function is finished. It makes you think about edge cases earlier on, and provides a firm "this is finished" or "this needs more work" indicator.

Yes Eric H, I’m talking to you when I say non-trivial. Writing tests for getters and setters is generally useless, unless you’ve got some complex behavior in the getter/setter, in which case shouldn’t you split that out into a verification function separately?

In other news, a couple of programming links which I recently rediscovered, and don’t think I’ve mentioned before. Good reads, mostly focused on language differences (which I guess makes me one of those crufty Python people that is interested in doing things the “right” way.

XML is not the answer. It’s not even the question. … “Some people, when confronted with a problem, think ‘I know, I’ll use XML.’ Now they have two problems.”

Python is Not Java

Technologies, especially programming languages, do not win on merit. … What about Python? Is Python hip, funny, and fun? Not really. The community is serious, earnest, mature, and professional, but they’re not much focused on fun, which is an important part of marketing languages.

A little anti-anti-hype

Comments

Camo

That first quote actually came up last night when we broke the search function. We disregarded it and drank the rest of our beer.