Coding some more on TMut

I know Tinymail has been a far-from-my-bed show for a lot of people. Especially since Modest hasn’t yet been released, it’s taking ages for me to do a first Tinymail release, etc etc.

TMut right after a cache reset (initial situation)

My opinion is that all these are just the normal troubles that most medium-size software projects go through. I know some people expected certain wonders coming from all this. Wonders we will create. My opinion is although what can be better must be better, Tinymail is getting nice. It’s not perfect. But nothing will ever be perfect in my opinion. Ask Tinne, I’m full of criticism about nearly everything, including myself. Nothing is ever good enough. Which is why Tinymail can be better and therefore it must be better.

Balancing perfectionism with pragmatism is probably one thing about my own personality that can be better. It’s definitely something that I’m improving. The good thing is that my philosophy is that it’s not the destination, it’s the path itself that makes life worthwhile. Let’s not be perfect.

The API to build an E-mail client is okay. For the first time I tried putting a simple one together from scratch. Before that, I was focused on what Modest needed. The advice on complexity in “Framework Design Guidelines” by the .NET gurus Krzysztof Cwalina and Brad Adams is to make sure that the simple use cases are easy, and make the difficult ones possible. Don’t try to make both easy. This too is certain pragmatism. I’m learning that real quality lies in this pragmatism. Being too pragmatic most definitely doesn’t lead to quality. Being always a purist, leads to total failure. Quality lies in the balance. I think this applies to quite a lot of domains in life.

TMut is definitely an example of a simple use case. Yet it supports Push E-mail using IDLE, multiple folders, IMAP, POP, NNTP. It does QRESYNC and CONDSTORE. It downloads messages in BINARY. It does local caching of once retrieved data. It consumes not only few bandwidth, it also uses few roundtrips to synchronize a folder.

Much more important in my opinion is that TMut’s code is clean. I could give you guys a line count and everybody would be amazed by how few lines are needed. It’s not (not at all) the point of software development. The COBOL days that software developers got payed based on the amount of typed lines are over. Much more important is that code makes sense.

In my opinion is TMut, while written completely in C, clean and easy to understand. Nonetheless it supports a lot, using little effort.

TMut normal usage (while cache is present)

Finally, after putting TMut together, I’m feeling satisfied about this aspect of Tinymail. It is a good API, it does work, it might not yet be ideal. Even from the point of view where you want to write code that makes sense, it’s doable to build a simple but capable E-mail client in less than a few hours.

That, was the goal that I had in mind a year ago.

What you’ll find in in TMut’s sources is what you need to do to implement a basic E-mail client for a phone using Tinymail. It’s not even a pragmatic quick/dirty thing. In stead (in my opinion) it’s clean and clear code. As typesafe as possible. Proper design. You can probably clean up a bunch of things if you’d do this with Vala or by replacing the GObject boilerplate code with macro cruft.