TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PHP to Django: Changing the engine while the car is running

2 pointsby adolfoabeggover 14 years ago

2 comments

Udoover 14 years ago
<i>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).</i><p>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?<p>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.
mattdwover 14 years ago
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.