mardi, janvier 26, 2010

Pick good names for your methods/data structures...

I had hard some time today, trying to get a clue about what is what in Apache Directory Server project.

When Alex Karasulu started to work on the project back in 2001, he had to design a brand new ASN/1 codec, producing LDAP messages. He named those messages and this codec "Snickers", just because he has used the "Snacc" ASN/1 compiler before (Snacc couldn't be used by the project, because it was not free of use).

So we had our Snickers codec, and SnickersXXX messages.

When I joined the project in 2005, I was crazy enough to think that I can improve this portion of code performances. Sure I did, but I picked some other funny names, "Twix" Codec and TwixMessageXXX messages.

Great ! It was funny, we laugh a lot, and congratulate each others, thinking how funny we were ... What I don't say is that I had to write a converter from Snickers to Twix messages, as Twix messages are used in the front end, and Snickers messages are manipulated all over the back end. So converting back and forth was mandatory.

Damn asses ...

5 years later, when I come back into this crap, I have *no* bloody idea about what is what. Is Twix for the frontend or the backend ?

When you pick a name, and when you think it's funny, just think about those, and probably you, who will not have fun at all when it'll be time to fix some code in this area, with no clue about what Twix and Snickers are...

A Pale is a Pale. Don't name it Chair because it sounds funny..