Ask HN: PHP or ROR.
I love PHP, tried Ruby though since I'm a Windows user, it didn't go quite well!
I love PHP, tried Ruby though since I'm a Windows user, it didn't go quite well!
If you're looking to learn a new language, Python's my advice. Ruby is good too, but it seems to be primarily used for web development.
If you already know PHP, learn any new language -- be it Python, Ruby, or something else. It's a good investment that will pay off in the long run no matter which language you choose.
Though, Django is pretty slower than any PHP framework(from the frameworks I've worked with)
Django was actually my first use of Python - so you can imagine how pleased I was to replace a custom PHP app with something I just learned - and in record time. (if you're interested, the web app was: http://www.snapact.com/)
I have noticed no issues with performance as compared to PHP.
http://www.alrond.com/en/2007/jan/25/performance-test-of-6-l...
PHP just can't match the Ruby language, and I have yet to find a PHP framework with the sheer level of awesome of Rails.
I currently have both Rails and PHP apps in production, and these days I charge extra to work in PHP because I know it will take me a lot longer.
It was easy to set up, has great documentation and an active community, and lots of encouraging case studies.
I've been a PHP programmer through and through for the past three years and had no complaints about it. That is until of course I met RoR.
After the first year or so of occasionally playing with RoR, I found that my PHP started to have a decidedly Ruby accent to it. I was making heavy use of create_function() and array_map(), and was designing interfaces that hid more and more of the inner workings of my code in abstractions.
Now I still do PHP as a day job, but I absolutely hate it. Not because of the language itself but because I have to put up with other peoples complicated procedural code. I'm not implying that everything has to be OO all the time, I'm instead referring to code written by developers who have absolutely no interest in OO programming or MVC when building fairly complex content managed site.
For freelance work, its RoR all the way. Because Rails imposes quite a fixed structure (fixed compared to PHPs open-endedness), I don't need to spend days trawling through someone elses code before I can get started on a site.
Now, there are frameworks in PHP as well, but they focus on different things. Zend for example is a collection of libraries that you can pull together free-form into a system of your design (though there is of course a recommended directory structure). This flexibility comes at a price, i.e. that you have to initialize and configure all the working parts of the MVC stack essentially by hand.
The focus of rails is unapologetically to make a site work now, and make it easy for the developer building it to make required changes for that site. This comes through in pretty much every interaction you have with the framework (unless of course, you're on windows!)
The Ruby language itself is an absolute joy to program with if you cut your teeth on OO programming. You really don't know what you're missing until you learn the inner workings of the object model. If I hadn't given it a chance (i.e. spend a good few weeks hacking away on a ruby-based project) I wouldn't appreciate the benefits of it, sort of like what Paul Graham was saying in his Blub Programming article.
I recommend Codeigniter - www.codeigniter.com