

PHP to Django: Changing the engine while the car is running - adolfoabegg
http://devblog.policystat.com/php-to-django-changing-the-engine-while-the-c?c=1

======
Udo
_In our case, the prototype was written in PHP with the kind of architecture
you'd expect from a prototype. There were 45 .php files in a folder with one
file called class.main.php. No templates. No classes. No consistent database
access. No MVC. No ORM. No tests. [...] it was still obvious that moving to
Django was in the best interest of our company (and my sanity)._

Isn't the entire point of prototype code to throw it away eventually? It's
okay if the code is messy, because it's just meant as a quick proof of
concept, right?

People think programming in PHP _has_ to be messy and insane. But what I find
even more amazing is actual PHP developers perpetuating this somehow. Case in
point, I just spent the night doing maintenance on a website where a simple
contact form was one monstrous 3000 lines copy-and-paste spaghetti code
disaster written in PHP by a very well-known, respected and well-educated
programmer. In the end I threw it away and replaced it with 50 lines of sane
and maintainable code, also written in PHP. The point of this anecdote isn't
to show how cool I am but to illustrate that there is something about PHP that
makes people switch off their brains. Which is kind of sad, because it is
possible to write very elegant things with it.

------
mattdw
Writing a session backend for Django to allow it to share sessions with PHP is
a pretty clever idea. To be honest, that's the only really interesting thing
they did.

