

Ask HN: Why should I switch from php to django or rails? - amk

Hey. I am a php programmer. I mostly work on a freelance/consultant basis. I use framework (Symfony or codeigniter) and ORM (doctrine). These tools are quite powerful, and what I have seen after a very brief look at rails, they provide pretty much every functionality (correct me if I am wrong).<p>Considering how much more easier it is to deploy php+mysql+apache applications, give me some good reasons why I should learn rails or django.<p>(One very obvious reason would be to take up jobs where the client wants me to work on rails or django. Let's ignore this point for now. Just consider that I get new projects and I am free to choose my platform/language)
======
mgkimsal
If you really _love_ your tools right now, don't switch.

I would suggest learning something else, though (I chose Grails a few years
ago), because at the very least it'll give you a new appreciation for your
toolset. You'll understand the strengths more, you may identify some
weaknesses (either inherent in your tools or how you use them) and start to
think about how to use your own chosen tools better.

I split my time between PHP and Grails now, for the most part (some occasional
other work) and knowing both I have a better idea of how/when to use specific
approaches.

You may end up hating your PHP toolset after a while using something else,
because you'll start noticing how verbose PHP makes some tasks (using a
framework like symfony can sometimes reduce that). Or you may recoil at how
ugly some of the Ruby or Python stuff feels to you. You won't know until you
try, but I think everyone should take _some_ time to learn a moderately
different platform at some point, if only to help to understand your own
platform better.

~~~
amk
I must confess that even though I have tried other php frameworks, I have
never tried any other language for web development. (I used ASP like 5 years
ago, but I guess that doesn't count now) I will give your advice a shot. Maybe
not just learn the basics about rails and django(already done that).. I'd
probably need to develop one or two projects to really learn the benefits and
pitfalls.

------
c1sc0
It all depends on what you want to build: if you see a future for yourself
where you do more than building traditional CRUD web applications, then
explore a new application field & a language that fits that field (e.g.
AI/Lisp, NLP/Python). I'm glad I did exactly that & discovered Python/NLTK for
NLP.

------
nudge
I really don't think there are any very convincing reasons, if you are
competent already with php+frameworks.

Perhaps Heroku for easy deployment? I haven't used it myself but I gather it
makes life easy.

The question to ask yourself is whether you find yourself doing things you
feel you shouldn't have to do, whether that's repeating yourself or creating
functionality that should already be built in or available as an addon. If you
are happy with what you have, it doesn't matter what everybody else is doing.

It only really matters if there is something discontinuously advantageous in
switching, for scaling reasons perhaps. But for now, I'd say your own existing
expertise in php would more than outweigh any advantages of switching.

------
imp
I've switched from PHP to Django for personal projects. Here's some random
thoughts:

\- Deploying Django isn't hard at all. No more difficult than LAMP apps.

\- Python is a better language than PHP (IMHO)

\- Tons of python libraries to work with. Wanna resize thumbnails? It's easier
to work with PIL than cobbling together imagemagick commands.

I've never worked with those PHP frameworks, so I can't comment specifically
on them. They're probably fine to work with, but I'll always stick with Django
over learning a PHP framework. The main difference is getting to use a
language like Python or Ruby instead of PHP.

~~~
amk
Yeah.. I hear that the languages themselves offer a lot of benefits rather
than the frameworks. I have just read some quickstart guides on rails and
django, so I guess I should spend more time trying to learn the language
first.

------
keytweetlouie
Django is a pure pleasure. You get all the power of python. The documentation
is great and the google user group is even better. Django gives you a bunch of
stuff for free ORM, admin interface, and authentication. Of course freedom
comes with a cost but their built in tools cover 90% of the common use cases.
Syntax in my opinion is much better in python.

------
fookyong
The only question you need to ask yourself is whether usage of these other
languages is going to filter down into tangible benefits for the customer.

If the answer is no, then arguing one over the other is just pointless fan
service. Try not to let it get in the way of you actually producing and
iterating.

------
grok2
If you are good at your current tools and aren't frustrated with them in any
major way, there is no need to think about anything else other than for
"expanding your horizons" type of thing. LAMP with PHP is just as good as
anything else. Remember there is no silver bullet.

------
steveklabnik
> they provide pretty much every functionality (correct me if I am wrong)

For me, it's not about the functionality. It's about the culture, and the
productivity. Also, I love Ruby.

> Considering how much more easier it is to deploy php+mysql+apache
> applications

This is not really true anymore. Rails is pretty easy to deploy these days,
especially with things like Phusion Passenger.

