Ask HN: PHP or ROR.
11 comments
I like Python. Fast to develop in like Ruby, but also well-suited to many different types of programming tasks.
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.
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.
I'd second the Python recommendation. Switching from custom PHP to Python (specifically Django) saved me a ton of development headaches.
Yeah, I used Django a few times before. It's very nice.
Though, Django is pretty slower than any PHP framework(from the frameworks I've worked with)
Though, Django is pretty slower than any PHP framework(from the frameworks I've worked with)
That's likely a false impression, and has to do with things like number of database calls, design, and other non-language-defining features. Don't let perceived speed be the deciding factor in your language choice: If speed was that important, you'd be writing in C.
When I first started using Django, I wasn't sure about it either, for a few different reasons - but performance wasn't one of them. Long story short, I'm glad I invested the time in taking it up...
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.
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.
This is an old link (that I wish would be updated) about performance of some various frameworks (in various languages):
http://www.alrond.com/en/2007/jan/25/performance-test-of-6-l...
http://www.alrond.com/en/2007/jan/25/performance-test-of-6-l...
Perhaps it is possible that Django's highly flexible nature is giving you enough rope to hang yourself here. Performance is not an issue for me, though (as always) I have to be careful not to do stupid things to the database.
Thanks, I'm pretty good in php. I love the Kohana PHP framework.
Definitely prefer Rails.
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.
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.
I personally love Django (http://www.djangoproject.com/) the python equivalent of RoR. I love the way it encourages me to architect my code well, rather than being encouraged to hack up every page (all too easy in PHP).
It was easy to set up, has great documentation and an active community, and lots of encouraging case studies.
It was easy to set up, has great documentation and an active community, and lots of encouraging case studies.
I feel your pain about the Windows issue!
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'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 use what I know best, PHP. It's not the language that builds a good site, its the person. I'd learn RoR if I thought it'd make a difference, but I don't think it would.
I'm a PHP fugitive, so take this with a pinch of salt. 3 years ago I thought Rails was worth the pain of working with Ruby on Windows compared to the problems I was facing keeping myself enthusiastic in PHP. Now you've got the option of developing Rails sites in JRuby, that pain is much, much reduced. Honestly, it's worth a shot if you haven't tried it yet.
Most people will answer with whichever language they know best. Both are well-supported and well-suited for building a scalable maintainable web app. Unless you're doing something truly earth-shattering that specifically requires features (or libraries) in one or the otheer, use whatever feels more intuitive for you.
[deleted]
If you're comparing the languages, Ruby beats PHP any day. But if you're comparing PHP with ROR, then you need to throw in a Rails like framework for PHP.
I recommend Codeigniter - www.codeigniter.com
I recommend Codeigniter - www.codeigniter.com
I prefer Ruby as well, but I definitely found being a Ruby newbie on Windows very painful. This was several years ago though.
[deleted]
I love PHP, tried Ruby though since I'm a Windows user, it didn't go quite well!