This blog is highly personal, makes no attempt at being politically correct, will occasionaly offend your sensibility, and certainly does not represent the opinions of the people I work with or for.
Transparency, discoverability and predictability, or lack thereof; why PHP web development still sucks
avatar

PHP web development is slightly better than the last time I looked at it. I still think that the language is horrible and that the engineering tradition in the PHP world is not very good, but at least it got a bit better.

I am saying this because I am playing with Laravel in this moment. Laravel is not bad. The guy who built it (Taylor Otwell) is probably a nice guy and kudos to him for what is, in the end, a not too bad piece of technology. That being said, and there is no nice way to put it, web dev in PHP (still) sucks... so hard.

Here are my problems with Laravel. The amount of magic in it. Now, there is magic and magic. There is (1) the magic of a service's clean and documented interface which in effect just acts as a black box (something that cleanly fulfils a need without bothering you with the details -- like a simple, no nonsense, TV remote control), and is without (undocumented) surprises, and (2) the magic of people relentlessly pursuing a career in "user friendliness", "ease of use" and "Harry Potter"; and in the process introduce as many leaky abstractions as possible; and when you are trying to do something slightly different than what can be found in the official online tutorial you are fucked; not because it might not work but because you have no idea what funky side effects you are introducing and probably should know about.

So, you do what people do when they have a problem like that, you turn to Google. Holding your breath because you've been doing this for a number of years and you know that some solutions are more pathological than the problems they are meant to solve. At which point Google just does what it does best, redirects you to Stack Overflow. To be fair sometimes it works, but then with so much magic built in and so much variations from one framework's minor version to another, you are left with the only thing that has ever worked. The...

Screw it, let's read the source code of that damn thing!


No seriously framework makers. I have nothing against you (well.... not more than usual), but please, there is a big difference between (1) an online documentation being merely a showcase of the fact that the most trivial cases can be implemented in half the time as the other frameworks, and (2) giving to your users a smooth path to a complete and accurate mental model of what it is that the thing actually does.

I know that you did let yourselves contaminated by the Rails mantra of "convention over configuration", that's good, sort of... (actually that's not even good...), but make it so that the time I need to spend on your documentation (or more often spent reading your source code) is only proportional to how far I diverged from your idea of "standard". Too often you users are like: "Oh yes! This [framework] is so awesome and so easy to use! You need to check it out!! It will change everifiiin... Uh, how to do [put here a simple thing]? I have no idea. Google it!"

On the other hand I like reading source code (it's like treasure hunting, without the sunburns), I will soon be a Laravel expert. I guess there are worse things to be expert in...

[ add a comment ]

Archives