Rants, kept to a bare minimum and strictly with a useful component.

My rule to see if a framework is worth of attention

I came up with a little rule:

In order to be worth of any attention, a framework must be stable enough that I can charge money to train people to use it.

This probably applies to other kinds of software stacks, libraries, development environments and, well, to most software applications.

In the context of python web frameworks, this means that:

  • If it changes API all the time it is not worth of attention, because my customers won't get value for their money, as they'd continuously need retraining and rewriting their software.
  • If I see lots of DeprecationWarnings it is not worth of attention, because my customers will see them and blame me for teaching them deprecated stuff.
  • If fixes for bugs affecting the stable version are only distributed "in a recent git" or "in the next development version", and they are not backported into a new bugfix-only stable release, then it is not worth of attention, because:
    • my customers' business is to develop their own products based on the framework.
    • My customers' business is not to be maintaning in-house stable updates of the framework. Although if the framework's community is nice enough they might end up giving a hand.
  • If it requires virtualenv or can only be obtained through easy_install it is not worth of attention, because:
    • my customers are not interested in maintaning custom deployment environments over time.
    • My customers are not interested in tracking each and every single library's upstream development to keep their production system free of bugs.
    • My customers are used to getting software through a proper distribution which also takes care of security updates.
    • I am paid to teach them how to use a framework, not a custom python-only package management system.
    • In my experience, if distributions have trouble keeping packages up to date, upstream is doing something fundamentally wrong.

In light of this rule, I regret to notice that I see very few python web frameworks worth of any attention.

Posted Wed Aug 4 15:32:24 2010 Tags: rant

On python stable APIs

There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

There is another theory which states that this has already happened.

In Debian testing:

/usr/lib/python2.6/dist-packages/sqlalchemy/types.py:547: SADeprecationWarning: The Binary type has been renamed to LargeBinary.

In Debian Lenny:

ImportError: cannot import name LargeBinary

I was starting to think that SQLAlchemy wasn't too bad, since I've been using it for 6 months and I haven't seen its API change yet.

But there it is, a beautiful reminder that SQLAlchemy, too, is part of the marvelously autistic Python ecosystem.

Posted Mon Jul 19 16:14:25 2010 Tags: rant

On python, frameworks and TOOWTDI

The Python world is ridden with frameworks, microframeworks, metaframeworks and their likes. They are often very clever things, but more often than not they are a tool of despair.

A very peculiar thing about Python web frameworkish things is that there are so many of them. There's cherrypy (in its various API redesigns), fapws, gunicorn, bottle and flask, paste, werkzeug and flup, tornado, pylons, turbogears 1 and 2, django, repoze who, what and whatnot, all the myriad of rendering engines and buffet as a metathing on top of them, diesel, twisted, and I apologise if I don't spend my day listing and hyperlinking them all, I hope I made my point.

Frameworks are supposed to standardise some aspects of programming; the nice thing about standards is that there are so many of them to choose from, and they all suck, so I'll make my own.

But wasn't Python supposed to be the world of TIOOWTDI?

Ok, everbody knows it isn't. Just in the standard library there are 2 implementations of pickle and 2 urllibs. But people like the TIOOWTDI idea.

I believe the reason people like the TIOOWTDI idea is because it creates a framework. It standardises some aspects of programming, and defines building blocks that guarantee that people doing similar jobs will be using similar sets of components.

Let's take for example the datetime module in the standard library. It is an embarassing example of a badly designed module, so embarassing that the standard library documentation continuously fails to document its fundamental design flaws and common work-arounds hoping that noone notices them, but as a consequence each poor soul starting to use it for nontrivial things has to google for hours in despair to rediscover in how many ways it's broken.

But still, datetime works as a structure to hold those values that make a date, time, or full UTC timestamp. For that job it's become the standard, and as such it's an important component of the Python TIOOWTDI framework: one can use it to exchange datetimes among different libraries: for example ORMs are using it instead of rolling their own, which makes database programming so much easier when date/time is involved.

Even if the implementation is far from perfect, once we apply TIOOWTDI to dates and timestamps, python code from different authors can exchange dates without worries. This is much better than having 3 different superior datetime libraries and having to convert date objects from one to another when passing values from a web form to an ORM.

There is an often overlooked Python framework. The Pyton framework. It's called TIOOWTDI.

All the micro-mini-midi-maxi-meta-frameworks that people scatter around, are, or should be, just experiments, proofs of concept, competing ideas waiting to be distilled in The Only One Way, bringing the Python experience one step forward.

What is unfortunate is that this last distillation thing happens so rarely that people get used to the idea of having to use proof of concept code to get things done.

Update:

this post apparently wasn't very clear, so here is some clarification:

  • that python, plus the idea of TIOOWTDI, in fact generate a framework, the framework;
  • that framework currently includes very little web stuff;
  • the web stuff is currently shipped in countless prototypes and proof of concept things;
  • something from all the prototypes people develop ought to be brought into the TIOOWTDI "framework";
  • otherwise people get used (or worse, forced) to use proof of concept throwaway code to get their job done.
Posted Thu Jul 15 21:27:20 2010 Tags: rant

A golden rule in Debian things

If there's something that doesn't go the way you think, write:

I don't understand, please explain me

instead of:

You don't understand, I'll explain you

In the first case, you'll likely get an answer that starts with "I'm sorry". In the second case, you'll likely FAIL.

Posted Tue Jul 6 23:40:21 2010 Tags: rant

On software modularity

Software modularity is good. You take many modular, reusable components and you join them together to create a bigger software that is more than the sum of its parts:

Voltron

But what happens if you try to put together all sorts of modular parts, each independently designed by a smart person who believes that their way of doing things is the best in the world?

A mess of a robot

It's not exactly easy to save the world in that.

This post has been brought to you after a lot of paid work on Python, WSGI and all those sorts of mini/midi/maxi/meta/macro frameworks people built with them, that always look really, really cool until you actually start to use them for getting a serious job done.

Posted Wed Jun 23 17:50:27 2010 Tags: rant

La paura e la voglia

Results 1 - 10 of about 5,470 for "la paura e la voglia di essere nudi". (0.34 seconds) 

Results 1 - 10 of about 26,500 for "la paura e la voglia di essere soli". (0.10 seconds) 

Poi non c'è da stupirsi se siamo diventati come siamo diventati.

Posted Wed May 5 13:36:24 2010 Tags: rant

Se è vero questo...

Se è vero questo...

...allora è vero anche questo!

Posted Thu Apr 22 09:26:08 2010 Tags: rant

Repubblica e tecnologia

Ho appena inviato questa mail alla redazione di Repubblica:

Subject: Ignoranza in materia di tecnologia

Gent. Venerdí,

in visita ai miei genitori stavo sfogliando l'ultimo numero del Venerdí e ho fatto fatica a trovare gli articoli, nascosti come erano le pagine e pagine di pubblicità alla Microsoft.

Per una frazione di secondo mi son detto "ma queste pubblicità Microsoft ridicole e piene di fregnacce non ledono la reputazione in materia di tecnologia di questo giornale?". Poi mi son ricordato che stavo sfogliando il Venerdí di Repubblica.

C'era una pagina di pubblicità Microsoft in cui si diceva che Repubblica usa Internet Explorer. Giusto, mi son detto: lo sanno tutti che non han mai capito un cazzo di tecnologia.

E infatti, piú avanti nella sezione nuovi gadget compare bello come il sole un pesce d'aprile di Think Geek.

Del resto, se Berlusconi può dire impunemente che cura il cancro in 3 anni, Microsoft può dire impunemente che Internet Explorer è il browser piú sicuro del mondo e rispetta un sacco la privacy. Giusto?

Appena si disperde sta nuvola di fumo io torno all'estero. Statemi bene.

Cordiali saluti,

Enrico

Posted Sat Apr 17 17:11:20 2010 Tags: rant

Firefox and automatic proxy configuration

Firefox supports automatic proxy configuration, which means that if you plug your laptop on a network with a properly set up proxy server, it will automatically reconfigure itself to use it.

Oddly enough, however, it requires garbage collection when you then plug it back on a network without proxy, in order not to get "proxy not found" errors.

Posted Wed Mar 10 20:03:39 2010 Tags: rant

Global trends

For some time I have been trying to pinpoint what it is that is brewing in Italy and risks spreading elsewhere, like it happened in the past.

I don't need to be decent to stay in power

While following a train of thought during a political/philosophical lecture I figured that a current growing trend is to have public figures that are more and more indecent.

In Italy it is very hard to find a public figure you can look up to. It is hard to name a politician that is not involved in some shady exchange of favours or some abues of their powers, and we got used to seeing people in power implicated in major corruption scandals, perverted prostitution affairs, or dealings with international criminal organisations.

They do not normally end up in jail, and in fact they keep being very firmly in power, because they manage to stretch or change the laws to get away, or at least to delay trials in order to trigger some statute of limitations.

Is there a pattern here that, although maybe not as clearly defined as in Italy, can be found more or less globally?

Yesterday I thought that this could be such a pattern:

I don't need to be decent to stay in power

If I think of it like that, then it is most definitely not just an Italian phenomenon. If you tell "one doesn't need to be decent to stay in power" to a British, or to a French, I would not expect them to see anything strange with it. We all find it depressing, but we are all used to it.

It is a pattern with repercussions, though: once that becomes normal in a society, it means that people who get to be in power are free to abuse their power much as they want, as long as they are careful enough not to end up in jail. Because, well, nowadays one doesn't need to be decent to stay in power.

I don't need to follow the law to stay in power

That first pattern is already quite well accepted in Italy. So much well accepted, that I think we are starting to see what comes next.

At the end of March we are going to have elections for some regional governors. Funnily enough, in Lazio, the very important region around Rome, the centre-right coalition failed to submit the paperwork on time, and is out of the elections.

It is not just red tape: at some point someone will have to print out the ballots and dispatch them to the voting booths, so one expects to have the coalition logos and the names of the candidates submitted in time, together with signatures supporting the candidates and whatever else the election process needs.

Well, they missed the deadline, they got there after closing time and the building was, well, closed.

It was a fantastic opportunity for a laugh. Memes blossomed on the Italian intarwebs and we now have 2 or 3 new expressions to mean "stupid".

However, now it's hard to tell what is going to happen. On one hand, you can't exclude one of the two major coalitions because of some bureaucratic detail like an office closing time. But on the other hand, several minor coalitions have been excluded in all sorts of past elections because of similar things, and it really would not be fair to start making exceptions now.

But Lombardia, the region around Milan and Emilia Romagna, the one around Bologna, both very, very important, are having similar kinds of problems.

In both regions the previous governors are running again, for the 3rd time in a row, and most likely they legally can't do it, and if elected one can sue and force them to resign, because they have been in power long enough. Lots of paper is being shuffled at the moment to figure if they can get away with it or not.

Oh, and the lawyers of the candidate for the Milan region also managed to get to the tribunal after closing time, but apparently there was still someone inside and they managed to shout loud enough, or somesuch.

Anyway, the situation is getting hot. The Lazio coalition that has been excluded because of their incompetence is now hard at work pushing their potential voters to mount a fracas. Chances are that eventually they'll get away with it, and manage to take part to the election. If that happens, they will likely get close to winning it.

So this seems to be a new pattern that is emerging:

I don't need to follow the law to stay in power

Which, again, is a pattern with quite some repercussions. It is something much more radical than just an issue with morality: it means feudalism, it means we are culturally ready to accept dictatorship.

So, please do me a favour: do not think for a moment that Italy is just a funny place with lemons and tomatoes, and watch out for these patterns emerging around you.

Posted Fri Mar 5 16:52:31 2010 Tags: rant