I don't do XP, but I try to hang around that crowd. They seem like such a super smart bunch of people with such clear and useful ideas and such nifty sayings. This is one:
I'm not a great programmer;
I'm just a good programmer with great habits
--Kent Beck
So, what are your great habits? Big and small. In your own journal or Comment here.
I'll start:
API-driven development
If you don't do test-driven development, at least do API-driven development.
When writing a method or sub, don't start coding right away. Start by describing what you are gonna code (hello POD). That way you
a) get a documented API, especially return values are nice to know without exploring the implementation three method calls deep
b) think things through one more time before coding
c) tend to think about (and possibly state) edge cases, assumptions and error conditions
Example I
=head2 raHistoryFromText($text)
Example II
Return array ref with hash refs (keys: version, user, date,
time, datetime, action, comment) with history information
in $text.
Return undef on errors.
=cut
=head2 parse(SQL::Map::Parser $oParser, SQL::Map::Database $oDatabase)
Parse the source text using $oParser, and modify this and
referencing objects in $oDatabase.
Return 1 on succes, else 0.
Abstract.
=cut