December 8th, 2005

diesel, learning, evil, sweeti

Urge. To. Rewrite. Email::Store. Rising.

I really hate the Class method design of Email::Store - something that just doesn't make sense to me but which I inherited nonetheless.

If I ever get the time I'm pondering rewriting it as object method because, it sort of makes sense to me - a store is an object and messages and threads etc etc are objects that can be retrieved from the store.

    my $store = Email::Store->new(%config);
    foreach my $list ($store->lists()) {
        print "List: $list->name has ".scalar($list->messages)." messages\n";        
    my $message = $store->message($message_id);
    print "Subject: $message->subject\n";
    print "From: $message->from\n";
    foreach my $attachment ($message->attachments) {
        print "\t$attachement->filename\n";

So now I need to

1) Find out why the original author did it like he did

2) Work out how to deal sensibly with a complete and utter API breakage and any existing users (call it Email::Store2 maybe ?)

3) Find time. Always with the time finding.

diesel, learning, evil, sweeti

On Python. And Perl.

Note to future self. I've been doing a lot of Python recently. True it's been on a fairly crack fuelled distributed rendering type affair and it's under 2.2 rather than 2.4 but ... there are many things to hate about it. Like the Lack of CPAN. and the weird scoping. And the indentation which bothers me more than I thought it would but for reasons other than I predicted - I still find the white space indentation hard to do mental scoping with but not as badly as I feared but I find the unhelpful error message when you mix space and tabs to be be annoying.

Actually I loathe the, to me at least, unhelpful and down right incomprehensible error messages in general although I concede that it's probably just that I'm more used to Perl's. The scoping seems batshit. The sort() in place bothers me almost as much as Perl's chomp() in place even though I understand the reason for both.

I find the docs suck. I bemoan the lack of CPAN. I can reel off a list of 20 things I hate about it.

But, of course, I can do 100 for Perl because I know it better.

And you know what - there's no difference between them. No practical difference anyway. No real compelling one. Sure the PyObC bindings are better than CamelBones but I'll care about that when I never buy a Mac. Apparently the GUI bindings are better. But the Database bindings lag far behind Perl. Po-tay-toe, Po-tah-toe. There are niches. This will always be the case.

As mentioned elsewhere the major difference between the two (aside from individual programmer familiarity) is the community. I shall leave that as an unqualified statement.

As an aside, I read this yesterday though :

"Another thing to notice is the little slam against Perl. How did Perl get involved in this? Da Silva was discussing Awk, not Perl. But the comp.lang.lisp folks can't stop talking about Perl. They are constantly talking about Perl. I looked into comp.lang.python to see if it was similar, and I found out that people in comp.lang.python hardly ever discuss Perl. I think that shows that comp.lang.lisp is sick and comp.lang.python is healthy: the Lisp folks are interested in Perl, and the Python folks are interested in Python."