[erlang-questions] Thoughts on EHE - the PHP killer

Tim Watson <>
Sun Feb 19 20:29:07 CET 2012

On 19 February 2012 10:52, Adam Rutkowski <> wrote:
> On Feb 19, 2012, at 8:37 AM, Matti Oinas wrote:
>> How come django is better than embedding PHP or erlang code into template? Django just adds one language so instead of 2 you must use 3 to get a working template.
> You can have an UI guy providing templates and he wouldn't be able to erase your hard drive with it.

More to the point, most developers I've come across seem to think that
code mixed with markup is an anti-pattern - admittedly these are
people who wouldn't touch PHP with a barge pole. I seem to remember
reading someone who compared the relationship between this and well
designed code with that of professional wrestling to real sport. The
tendency is that the 'script-let' approach makes both the code and
markup harder to read and comprehend despite their proximity and
obvious connection in context, encourages lazy developers to allow
business logic to become interspersed with presentation logic, makes
it harder to test both (certainly from a unit testing point of view)
and generally sucks from a maintenance perspective.

I mean for crying out loud, most people who're working on the pure
client side of web development with js libraries like
backbone/jQuery/etc are trying really hard not to mix up the content
and the layout, with backbone going as far as to separate the
model/backend, presentation logic (controllers) and rendering (views).
As I've said previously, I'm not a huge fan of MVC as a pattern, but
the premise upon which it is based is a good one even if the solution
is a bit over complex IMO.

Doing what's simple isn't always the same as doing what seems obvious,
which when I hear 'do the simplest thing that can possibly work' makes
me ask 'but is this *really* the simple thing to do?' Dijkstra, who
was obsessed by simplicity, also claimed that 'elegance' is not a
dispensable luxury but a quality that determines between success and
failure. I don't find anything 'elegant' about embedding code inside
of web pages, and that's not an aesthetic judgement, but one that
comes from working with medium to large, multi-disciplinary teams,
where 'sites' might have hundreds or even thousands of different views
and considerable logic behind many of them. In an environment like
that, especially when the system(s) are business critical and/or
customer facing, you fight for your life to keep a strict separation
of concerns, or you end up failing because of the inherent complexity
and loose your reputation as a team lead as well as your bonus.

More information about the erlang-questions mailing list