Hacker News new | comments | show | ask | jobs | submit login
Ask HN: django vs php: a hard choice
14 points by kamme 3286 days ago | hide | past | web | 27 comments | favorite
I'm making plans to start my own killer-webapp and I just can't decide in what I will develop it.

I am currently a php developer so I know my way around php and I'm able to make the application I have in mind without any problems. But I'm also very interested in django, a relatively new thing for me but it sure does look promising and worth my time to invest further.

I tend to choose php because I know it, I know it is well supported, it scales without large problems, I can configure it and optimize it without a problem.

While django is very fast in terms of development time, it's a challenge, probably good for my career if I can add django/python developer to my CV and it has a great community.

But I have doubts for choosing django... For starters, I don't know if it's 'economical' to choose django in terms of performance. Does django beat pure php in complex sites pageviews? In other words, do I have to scale faster with django then with php? Will I be able to find additional programmers if my website becomes a success? I live in Europe and I don't have the impression django/python developers are common here (prove me wrong!). How is the support going to be? I'm always surprised to see very old php4 code runs fine on the newest php5 release, but I heard djando changes quite often and you have to re-write code if you want to use a newer release.

Like I said, I don't have any real-world experience with django, so I'd like your advice/thoughts on this.

A few points:

- Don't worry about scaling problems - if you have scaling problems you have a succes already. 99% of startups unfortunately never get to have scaling problems.

- The main focus should be to get the killer-webapp up and running, not getting a CV or trying out a new technology. Starting a company is in itself a huge challenge. No need to add to the risk by trying to do it in a language you're not familiar with. If you're good at PHP stick with it.

Just my two cents...

Where in Europe are you from btw?

You do realize you're comparing apples to oranges right?

django is a framework, and PHP is a language. You should be comparing django to CakePHP (or whatever) or PHP to Python.

Assuming the latter, having gone from C++ to VB (pre-.com) to ASP to PHP to Ruby (briefly) to Python, I really prefer python as a language.

I think mixmax's advice though should be heeded.

It's OK to compare apples to oranges here, since as I understand it, he tries to decide whether to use "bare" language or a framework.

> You do realize you're comparing apples to oranges right?

They may be different, but the choice is not orthogonal: you can't choose to use django and php for the same piece of code.

Do a weekend project in Django and see how it works for you.

It's certainly a good skill to have from an employment point of view - the Django job market has exploded over the past year, see http://www.djangogigs.com/

Stick with what you know. Having said that, at some point I recommend learning a better language than PHP, like Python. Coming from a PHP background myself, I can honestly say that my programming life got noticeably better after having started writing everything in Python instead. That was a couple years ago and I wouldn't go back for anything.

Trust me, go with PHP. Django is good to use if you are interested in learning a new language an improving your skills in python, but if you are interested in starting a company, then absolutely go with PHP. I've used Django for 2 big projects now, and I'm telling you this from experience. Here is why:

1. Django is quite difficult to learn. You'll waste a month or two getting into the framework

2. You will NOT find developers to work on Django, and the ones you do will be VERY expensive

3. Once you know Django well, you'll find that there is not that much of a faster development cycle than PHP, unless you are doing something newspaper related. For newspaper related sites, there are shortcuts, but for everything else, it's pretty much the same routine

4. Hosting for django is expensive. On a $10 a month host, a PHP site will run fast. For Django you need to get a $100 virtual server. Big difference.

5. Django does very little PR, so the language seems to be cooling off in terms of visibility. This means - less applications, less snippets, few books. It's becoming a bit of an elitist culture, which sucks big time

6. The IRC channel is becoming like the C++ channel. Snobby and condenscating.

Recently, a person I know decided to rewrite his entire Django app in Rails because he could not find any developer for his Django app.

It's not a hard choice. Go with PHP.

Could not disagree more with some of your points:

1. Django is NOT difficult to learn, in fact I found it very intuitive and easy.

2. This is definitely improving - more and more django developers all the time.

3. Django may have started at a newspaper, but there is nothing newspaper specific about the framework design. Sure there may be middleware modules with newspaper related functionality - but you don't need to install them!

4. WRONG! webfaction.com has great service and easy django hosting for under $10.00 and Django installs with one click!

5. How many books do you need to figure it out? I have a dozen Django books - most of them really good. But I still get most of my Django information online.

6. Well, is it really true or just a reflection?

It's not a hard choice - if you like working with great tools and a great language go with Python/Django; If you hire someone else to do it for you go with whatever makes sense for hiring and the economics of software development.

One of my deciders is how many people are blogging or writing to mailing lists with problems or tutorials or sample code, whatever. Django is really a nice framework, but when you start googling specific issues, e.g. working with an ajax lib or finding/deploying to a VPS/ shared host, ther'es a lot more blog entries on specific issues/techniques that people have used in PHP than in Django. Also true for PHP activity in delicious, subreddits, stackoverflow, and the wall of PHP books at Borders.

You might want to look at the recetn django articles




"... tend to choose php because I know it, I know it is well supported, it scales without large problems, I can configure it and optimize it without a problem. ..."

Then stick with it.

Django released version 1.0 earlier this month so your concern about it changing out from under you is probably a non-issue.

You should try it for a small test site. Either you will like it or you won't. IMO, scaling problems in web apps are a application design issue, not a technology issue. JM2C.

I'm a longtime PHP developer who has been flirting with server-side JavaScript frameworks recently, including building a couple production apps in Helma.

For my current RAD project, the client has their own IT staff who don't want to support another environment, so it was back to PHP. On Rasmus' good words, I tried using the CodeIgniter framework (never used a pre-existing PHP framework before) but ran into pain with its many kludges to support PHP 4. Then found Kohana, which is CodeIgniter rebuilt for PHP 5 only. I'm lovin' it.

I was all gung-ho for server-side JS, but Kohana combined with my own ORM is going very nicely. (I don't know about Kohana's ORM--I started working on mine before I had decided to use any framework.) The biggest benefits, of course, are that it runs most everywhere and my long experience with PHP prevents the odd surprises I was always running into with the JS frameworks.

And, hey, first class functions and closure are coming in PHP 5.3!

So the grass isn't always greener--it seems what I was missing was a better way of organizing my code as much as straight language power. So try a good PHP framework--I recommend Kohana. And even though python and js are more powerful languages, having a whole bunch of stuff already built for you and ready to run anywhere beats power and a clean room most of the time.

My day job has me hacking in CI but I always wanted to give Kohana a shot. But you have to admit CI has done a good job in creating a PHP framework that is enjoyable (a word any serious programmer would use to not describe PHP) to work with.

PHP 5.3. is exciting stuff yet my worry is that most PHP code monkeys will not give it's feature set a second glance. On a unrelated note I've been working with HaXe to produce PHP apps. So far I'm LOVIN it! Do give it a try.

I thought the straightforward handling of routing in CI and the other basic plumbing was very nice. I really didn't like the way you have to load all the other classes wacky-style to work around PHP 4's deficiencies. So it was as much maddening as helpful for me. Kohana is just like CI, except without the PHP 4 fail.

Of course most people won't get into the PHP 5.3 features, but I'm not going to lose sleep over it.

And HaXe... I've been thinking about it for a long time, but I always end up thinking no. What's the web framework and view/template story there? It doesn't appeal for writing client-side JS b/c there I have jQuery, and I very much doubt HaXe would end up easier to write.

check out the symfony framework for php - http://www.symfony-project.org/

It has MVC architecture, is decently fast, and has an active community behind it.

I'd second this. It takes a bit of work, but puts you nicely into a MVC framework and makes it easy enough to bring in developers/designers. Developing in Django would be for a side-project, but if you write your app in a new framework, you'll find that you have to go back and fix most of what you initially write. It's not a bad thing necessarily, as long as you're not concerned with speed-to-market and (initial) code-quality. As some others have said, do a small side-project (I'm sure you have dozens of ideas!) to get into the swing of python/django. Either decide what framework to use and start from there, or immediately begin work on your webapp while picking up the Django skills.

Good luck either way!

I have been bouncing back and forth between Django, Ruby on Rails, merb and many other frameworks/languages for the exact same reasons. I'm a nerd, I enjoying learning new languages and it would look great on a resume to have a few more under my belt.

But - I always come back to PHP (and the wonderful CodeIgniter framework) when I actually need to get something accomplished. I know it like the back of my hand and I don't care what any of you say about the other languages and frameworks - I could not develop my applications anywhere near as quickly as I could in PHP.

Yes, some of those frameworks are designed for rapid development - once you know the parent language! I say find a powerful framework for PHP designed for rapid development and stick with what you know. Play with Python and Ruby on your own time.

Django 1.0 was released recently. It's a good time to jump in. Strange as it may seem, you can use both. I do.

But all advice is quite pointless -- suppose you decide not to try out Django. Without actually realizing how it works, you will always have lingering doubts about whether it would have served your purpose better.

A lot of people don't understand the difference between Flash and Flex. There is a large overlap in functionality, but a big difference also. Should I use Fs or Fx? Without actually using it for a bit, you can't tell.

It's like going to a restaurant and seeing somebody eating something. They look happy eating it, but you don't know if it fits your own appetite unless you try it yourself :)

Django v php is a strange comparison. Framework vs language.

Python is a nicer language than PHP, and Django is a nice framework. If you already have knowledge of php then you can probably get your app running faster with a php framework such as Symfony.

I agree with other posters. If your one and only goal is to get your site up and running, then for sure stick to what you know... Use straight PHP or a PHP framework.

If however, you have the dual goals of getting your site up and running and also learning new and better technology that has the possibility of making you more effective in the future (initial development on your current project will be slower, but it will pay off in the long run), then go with Django... Or Rails... I'm a recovering PHP-aholic, who's moving onto Ruby, so I just had to put that in.

Good luck.

I'm surprised nobody recommended CodeIgniter to this guy. Which is by far IMHO one of the better PHP frameworks out there. Also do try Kohana as well! as I heard it's a more powerful version of CI.

Thankfully my day job consists of me hacking in CI (which is a Godsend) but my current passion lies in HaXe. So if anything try out other languages to expand your mind. But if you don't have the time and luxury and you want to get that killer app up and running. You might as well stick to your main competency and slug it out in PHP.

I second this. CI is a great framework. It's by far the fastest PHP framework out right now, and has terrific documentation.

If you're a PHP guy and know, as you said, that you can get this out fast and well in PHP then definitely don't try killing yourself to produce it in Python atop Django.

However, if you're truly interested (and you've got the time! which you don't!) in Python then give it a go as Django is a marvelous framework. You'll probably also find that you prefer Python as a language as you become more familiar with it.

If you know it, stick with PHP...you can create your app rapidly instead of picking up the nuances of a new language/framework. While there are a lot of criticisms of the language, the fact is there are tons of resources available if(when?) you need it.

And, reiterating what some of the other posters have said, don't worry about the scaling. A well designed app in PHP or Django or Java or Rails (Twitter failed because of its flawed design...not because Rails sucks) or whatever else will scale.

You're kind of asking two questions in one:

PHP or Python? and Framework or homebrew?

If you switch from PHP to Python and things don't work out, you'll blame Python. I'd stick with PHP.

If you use a framework and it doesn't work out you can just code away from the framework. I'd go with Zend Framework. It takes some effort to learn the router stuff, but never seeing another url that ends with .php is worth it on it's own.

Good luck!

Most people in the real world use PHP, but those on reddit and HN tend to go against the grain and use Python (or Ruby). If you know PHP, don't bother changing; there's nothing wrong with it.

A few points:

- Don't worry about scaling, like mixmax said.

- The main focus should be to get the killer-webapp up and running, not getting a CV or trying out new technology. However, you don't have to step far outside the PHP communities to see people shitting on PHP everywhere.

If PHP is the only thing you know, do yourself a favour and widen your horizons. Not necessarily for this particular project, but because when the time comes, and you are getting fed up with PHP's shortcomings, at least you know there is a way out.

Me, myself? I'm a heavily invested C#/.Net developer, but prior to that I have worked with Atmel AVR Assembly, Motorola 68k assembly, Basic, Pascal, Python, Arexx, C, VHDL, Verilog, LabView, Matlab, Java and god knows what. Oh, and yes, PHP.

I may stick to C#, but I know there is another world out there. So should you.

Applications are open for YC Winter 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact