173 Comments
- dirtyhand, on 10/10/2007, -9/+80Should've been called: 7 reasons why I gave up on rails when porting my php code
- fuzzmeister, on 10/10/2007, -13/+75For all its flaws, PHP can't be beat for sheer simplicity and development speed. If you aren't careful, you'll end up with a bloated mess of code, but it will work, and you will have written it in a fraction of the time it would have taken in another language.
- CraigJ, on 10/10/2007, -5/+45"If you aren't careful, you'll end up with a bloated mess of code, but it will work, and you will have written it in a fraction of the time it would have taken in another language."
Pretty much like any language. - pantuky, on 10/10/2007, -6/+41You know folks, as a guy who has been programming since 1982, and been a professional since 1994, I can honestly say that Ruby has been the biggest "So-What?" experience I have ever had when making contact with a new language.
1. Slow as hell
2. Mostly derivative of Python as far as dynamism is concerned
3. Most of the rails ideas such as DRY, and MVC, IOC, and test-driven design are not at all associated with Ruby as a language spec. These are abstract architectural concepts. Nice that DHH put them all together.
4. By the way, there is no language spec, which has been the downfall of the JRuby project
5. Then we have the truely ghastly and dastardly omition of threads. Ruby made no provision for explicit or implicit parallelism until 1.9 which gives us something called a "Fiber".
Anyway, in the world of multiple servers, multiple processors, with multiple cores, which just might be hyperthreaded, a language that doesn't make big provisions for delegates, threads, and semiphores has no real place in this world. - seventoes, on 10/10/2007, -3/+27Or just save your classes..
- Cwo655321, on 10/10/2007, -3/+27possibly in some sort of "framework?"
- Cwo655321, on 10/10/2007, -2/+24forgive darkervisions, he's what we call a "user"
- fLUx1337, on 10/10/2007, -3/+24If it ain't broke - don't fix it!
btw, good time to mention - if you wan't to use the good bits of rails in PHP, CakePHP is a great way to do it. You have the great structure of rails (MVC), but you still use all your php skills which you have mastered over the years... Win - Win. - SloppyJoe, on 10/10/2007, -2/+20That's only awesome.
- oneblackcitizen, on 10/10/2007, -1/+18from the comments on the page:
"This is a problem with any web framework. The idea of a framework is to make decisions for you, and if that doesn't work for you then it's the wrong framework. It's not a hit against Ruby in this case, just a hit against Rails." - kd1s, on 10/10/2007, -2/+19I worked with a PHP genius once. He wrote the most beautiful and modularized code. Even commented the code! It was done well enough that a hack like me could modify the code without any problems at all.
- cmer, on 10/10/2007, -6/+22The only things that could make me move away from Rails are:
- performance
- deployment hell
Apart from that, it kicks major rears. - justcursedme, on 10/26/2007, -3/+17Quote:... PROGRAMMING LANGUAGES ARE LIKE GIRLFRIENDS: THE NEW ONE IS BETTER BECAUSE *YOU* ARE BETTER! ... That one is damn.
I'll give you this Mr. Derek Sivers, although a bit subjective (as a blog should be nonetheless), you pointed out the most important reasons for choosing PHP over Rails. It's my guess that it comes to one aspect. Mature thinking. Great article indeed. - jstanden, on 10/10/2007, -0/+11What have you written in PHP to build your opinion it's not ready for enterprise-scale? What obstacles did you bump into?
I'm not PHP's biggest fan, but to compare it to Visual Basic is pretty disingenuous. In reality, you'll find most of your "masses" who came from working with VB will stare at their blank white page in the browser indefinitely. "How do I drag a textbox onto that?"
I think, in fact, the real interesting thing is that many people didn't bother to sit down and really understand good coding principles until Ruby rolled around and was the cool and trendy thing to be using. People started being exposed to patterns like MVC or DAO, which existed in C/Java/PHP/etc, but this is the first time those people have paid attention. No doubt that's one thing to credit Ruby with -- but those same people also need to realize those programming concepts are portable. That's the beauty of really understanding the art of programming. - misterjangles, on 10/10/2007, -0/+11I just hope now that he has re-written the code to separate the layers - that they hire a designer and do something about their terrible looking site.
- asdfasdf, on 10/10/2007, -1/+12I used to code everything in C. Be it GUI apps, OpenGL or even CGI scripts. I did it because I wanted to learn what goes on behind the scenes. I did not want to use any third party modules or frameworks because I thought it would be beneficial to know the nitty gritty details and have 100% control of my code.
I was ignorant. I admit, I learned a lot about what goes on under all the fancy high level languages and frameworks, but I realized that I wasn't getting anything done. There's more to completing and releasing projects than just the initial code. Is the language easy to maintain? Does it scale well? Is security going to be all up to me?
I eventually moved 'up' to PHP. I LOVED it. Imagine going from writing CGI in C to using PHP. I didn't have to write a string library for God's sake! PHP was great but it was hard to maintain. Maybe I was a crappy programmer, but I hated opening up people's code and having to learn their naming conventions and translate their database queries to my own. I hated layout code being mashed together with everything else. Designing layouts was a nightmare.
Then I tried Rails. It took me a good 2-3 years to get persuaded into it, as I figured it was a fad that will die down. I fell in love with it -- but not at first. It was hard to get used to, but I quickly saw the beauty and simplicity in it. Not just the Ruby language (not surprising that it came from Japan), but also the framework itself. Everything worked beautifully (unless you didn't follow the Rails conventions, Gods forbid!).
Rails does have some cons though. The Rails community is tiny compared to PHP or Python (Python is a great language that I suggest everybody learn. I use it for all my scripting needs, although I'm slowly shifting to Ruby for that).
It's not as fast as PHP, not unless it's tweaked anyway. It's new though, and they're working on this issue.
One other problem is that people complain about it being limiting, but I see forcing you to put your layout code in a separate file from your low level functions is a good thing, and so are the naming conventions. You'll see when you go to read your own code months/years later, or when you have to read other people's code. I agree that this is not for everyone and some would like to code as they please - I still fire up vim/gcc and break every damn convention once in awhile.
Oh and if you have code you want to port over to Rails, think about writing it from scratch if you really do want to get on the Rails. RoR really hates when you don't follow conventions, and it doesn't make much sense trying to fight with it, as your final product will probably not have much of an advantage over your older code if you're going to hack Rails up to disguise it as a language it's not.
BTW, for those bashing Mongrel: Rails can use Apache. For those bashing migrations: Rails can execute low level SQL like PHP. - Cwo655321, on 10/10/2007, -1/+12thats true, it can happen with any language; but its much easier for "loose type" languages to go awry.
- vh1`, on 10/10/2007, -0/+10this is a perfect example of the differences in the audiences of digg and slashdot. this is by no means a good article. it's an article from a developer who made a very bad decision and whose reasons could apply to any two languages / frameworks
"many setbacks were because of tech emergencies that pulled our attention to other internal projects that were not the rewrite itself".
instead of trying out rails for new projects, he is doing a total re-write without thinking of what would be needed for the job, or if the whole idea is even necessary. he chose rails purely because it was the new hotness. very stupid idea, and it took him two years to figure it out. hopefully he knows better now
it's easy to shoot down all of his reasons for switching back, but I don't want to seem biased. my roots are in PHP but I've moved to rails, not because it was new and hot, but because I'm a freelance developer who doesn't have to worry about large deployments (yet!) and doesn't want to rewrite a dispatcher/mapper/activerecord/RESTful framework in PHP when there is one already available
one thing I've noticed though in switching from PHP to ruby is that coding is more fun. no more dollar signs, greater-thans, (not as many) parenthesis. RJS, HAML. it's just more fun - centic, on 10/10/2007, -0/+9I like CodeIgniter far better then CakePHP as an MVC framework for PHP
- phosphodyson, on 10/10/2007, -3/+12I took a look at the site, cdbaby.com. If it took you 100,000 lines of code to develop that site, you must be one of the worst coders on the planet. All the site is is essentially a shopping cart. I have no idea what sort of implementation you had, but this site should've taken at most 3 months tops to redevelop in ANY modern web language. Perhaps it would've taken two years if you were writing it as an Apache module in straight C. (Hell,, I can't even see how you would need more than 3 months if you wrote it in C++). The developer is a rube, probably doesn't even have any real world web experience or understand good engineering and re-usability. This is probably a one/two month project in RoR tops.
I've worked on sites that are orders of magnitudes more complex than CDBaby, requiring much more sophisticated UIs and business logic both in RoR and in other technologies. It didn't take me two years to develop any of those sites. We're not getting a complete story here, sounds more like this guy just hacks code together in his spare time. - MellerTime, on 10/10/2007, -1/+10Uhh... What exactly is Rails? What's that you say? A "framework"? Golly jeepers!
Rails is a framework built on top of Ruby. Comparing PHP to Rails is like comparing Ruby to CakePHP or Code Igniter, or any of the other millions of PHP frameworks available. That's the *point* of a framework: to build upon the core language and make 99% of your daily tasks simpler.
Let's compare apples to apples, shall we? - boffert, on 10/10/2007, -2/+10I like Ruby, loath PHP but love Python.
And as a result I'd recommend Django. It really is an incredible web framework. :-) - dafragsta, on 10/10/2007, -3/+11I went through a similar emotional high when I first started learning about rails. I must've spent the past year learning about it and even found a lot of good things to still like, but in the end, I realized I was wasting my time. PHP has so much more to offer in terms of code that's already ready to go. I doubt there are many web applications that couldn't be built on Drupal and by doing that, you are doing most of the heavy lifting. Someone else is worrying about the security, the CMS, the MVC, the templating system, the scalability, etc.
- Archon810, on 10/10/2007, -4/+11That is one of the dumbest comments you could have posted.
- 21chrisp, on 10/10/2007, -2/+9So the author of this article underwent a total conversion of an extremely large code base to a brand new language/framework without any significant previous development in it. The problem is not the language or framework. It's the methodology that's way off. I spent almost two years just using Rails for deploying small non-essentail web-apps before moving development of flagship apps to it. You wouldn't even be able to keep up with the pace of development if you immediately started using Rails for such a huge conversion, especially when Rails was in its infancy. It's too bad that Rails gets the rap for this guy's poor decision making.
He answers "no" to the question: “Is there anything Rails can do, that PHP CAN’T do?”
Answering "no" to this after two years of Ruby/Rails experience is completely baffling to me. Not only can Ruby do many things that PHP can't do, most of those things are CORE to the language. Ruby is built as a metaprogrammable language and PHP isn't. You don't build "libraries" in Ruby, you build your own frameworks and domain-specific languages. Where do you think Rails came from? (cake/symfony do similar things but are not equivelant). At least that's what you're supposed to do. Of course 99% of those that come from PHP or Java backgrounds don't even try to do this and the entire point just goes right by them. The end result is that they say PHP/Java is better because the only thing they learned is that MVC is good. The reality is that they're writing PHP-style code in Ruby and of course this is a royal pain. PHP can't yield to code blocks and modify contents within those blocks. PHP can't store a block's execution environment, pass it around and run it as needed. PHP can't dynamically inject/modify code in classes and objects conditionally at run-time. If you're writing Ruby code and not doing these things, then you're just scratching the surface.
PHP is good for what it is, but saying it can do everything Ruby can do is like saying C can do everything PHP can do (actually it's even worse because PHP is much closer to C than Ruby). I'm not knocking PHP either because it happens to be one of my favorite languages. This is just not the mature argument it's being made out to be. This guy made some very bad decisions. - akula696969, on 10/10/2007, -1/+7I think what crazy is talking about is the problems Twitter had a time back when it suddenly grew exponentially. Somebody blamed it on Rails and claimed that rails could not scale. The problem was actually in the database schema, but the myth stuck and people claim it as fact even today (as proof with this post).
- inactive, on 10/10/2007, -2/+8if you love him so much why don't you marry him
- inactive, on 10/10/2007, -3/+9The author didn't mention any reasons why he thought PHP was better than Rails. All the reasons were revolving around his company being established in PHP. At least mention the scalability issues of Rails. Personally the reason I use Rails is it's fun to use and we only use web applications we develop internally so there's no hit for inefficiency. I don't think anyone in the world would rather use PHP than Rails unless their website traffic or company demanded it.
- Archon810, on 10/10/2007, -1/+7So did buying this shirt make me creepy? http://www.thinkgeek.com/tshirts/coder/595d/ Crap then!
- Herolint, on 10/10/2007, -0/+6I think this is a great article because it shows how hard it is to let go of old habits and think things through in a new way. As the author says, "is there anything Rails can do that PHP can't? No." The reverse is also true. Therefore, the big hurdle to overcome was not Ruby or Rails, but the mindset in doing something in a different way. As the author says, he loves SQL and always fought with Rails because he couldn't get to his beloved SQL queries.
To me, this article is not a comparison of which language/framework is better at all. It is an excellent look at how developer habits and mindset can be a difficult thing to overcome. - tdous, on 10/10/2007, -0/+6Didn't read that way to me. Seems as though he realised that he, as with many people, are much more comfortable with hands on control and flexibility than in the fluffy comfort of a hand-holding framework, let alone the practicality of performance.
PHP's biggest problem, imo, is the low barrier to entry meaning a lto of bad advice and bad examples are out there. Learn to code better and it will function very efficiently for most tasks. - till, on 10/10/2007, -0/+5Sorry, but "classic ASP" makes ASP sound all good. But it is really not. :(
- till, on 10/10/2007, -2/+7The Rails people are pretty good at avertising their "product". You have to cut them that much slack. :) Look at the videos and so on, it seems to be all dead simple. What annoyed the hell out of me is the complexity as soon as you get past the example-blog-app and would like to do something else. But that's one of the setbacks you have with most frameworks and any language.
All in all, I share your "so what?". - inactive, on 10/10/2007, -1/+6Comment in the blog: "Your website looks like a spam site"
HAHAHAHA! It really does look like a domains squatter/spam site. - CircleFusion, on 10/10/2007, -0/+5One criticism that someone made in the comments, that made sense to me, is that the CDBaby owner (Derek) decided to keep his existing tables and forcing rails to work with those instead of rewriting the data relationships from scratch. I don't know where the comment-writer got that idea, but if it's true then I can imagine that undermines how Rails intends to work.
Also, another comment that was made, which I agree with, is that Rails is a framework. Any framework is designed with opinions of a certain method of doing things. If that method doesn't work for you, then you certainly shouldn't use that framework. This, however, isn't a mark against the framework, necessarily. As Derek stated in the comments, this has more to do with his preferences than anything.
Me personally, I'm looking into Django. - till, on 10/10/2007, -0/+5http://php.net/overload ?
- Herolint, on 10/10/2007, -1/+6I would agree that it is faster to hack together a simple page in PHP than it is in Rails, but on larger projects, I don't agree at all. Like anything else in the computer industry, I always find it is best to use the right tool for the job. I don't understand people that learn one language and become religiously attached to it. Just like hand tools, there is no such thing as a single language for every situation.
- SpoBo, on 10/10/2007, -0/+5he is ... right. Ruby made me despise every language I knew up to that point. I even went as far as ignoring all other languages. But what I realised now (after taking a job coding .NET :s) is that other languages can make use of the same practices. Although not as brilliantly as Rails uses Ruby. Anyway, I still would prefer building something new in RoR but if you have to make adjustments to existing projects it's good to know that things can be done more efficiently and practically.
- smhill, on 10/10/2007, -3/+8"I hired one of the best Rails programmers in the world (Jeremy Kemper aka bitsweat)"
"Two years (!) later, after various setbacks, we were less than halfway done."
Those two comments conflict.
There is no reason cdbaby couldn't written in rails in a few months tops. It is either a developer problem or ***** client problem (putting too many demands on the developer). I have done far more complex sites much less time in both php and rails. Could also be as mentioned before simply "porting" a crappy site architecture and trying to force on rails. I see absoluetly nothing in cdbaby that is complex that would require that much work. Probably they have a really bad schema and descided not to redesign the database. Rails uses a standards and convention and relies on a specific standard for it work properly with the database. If you have a really crappy database design it would be a nightmare to force rails to deal with it.
There are differences between PHP and Rails/Ruby (both good and bad), but this article doesn't address them in any meaningful way. All this article shows is what happens when you hire a lame developer, or don't bother to learn how a framework/lang works or if you have a really bad site architecture. It isn't about Rails or PHP at all.
A competent developer could create a site with the functionality of cdbaby in a month or so easily in PHP/Rails/Djanjo/Zend/Cake/whatever if they know what they are doing.
But I guess it easier to blame the tool than person using the tool. - MoneyShot, on 10/10/2007, -1/+6How about the Python MVC frameworks? (Pylons, TurboGears, and Django being the ones that immediately come to mind.) I heard that reddit.com is being ported to Pylons. Django is also really picking up steam in the web publishing world. Performance-wise, Python kicks the crap out of both PHP and Ruby.
As a web programmer, I used Python almost exclusively nowadays. I feel like slitting my wrists every time I have to do some maintenance on a PHP app. Seriously, I've been a web developer since 1997 and have created sites using Perl, ASP classic, ASP.Net (Vb.Net and C#), PHP, Coldfusion, and Python. The minimalistic philosophy of Python is amazing. - chazzy, on 10/10/2007, -0/+4I think by "deploy" bngu means that the latest trunk code is checked out, all tests execute without an error, all of the servers are moved to the maintenance page, SQL database is migrated, new code is deployed, tested on the prod servers, each of the web servers restarted. Takes 5 minutes, but it's a one-liner. And a one-liner rollback if something goes wrong.
But I agree that Capistrano is a pain in the ass to set up. The way I look at it, I'm happy to spend 2x as much time up front as I would for each of the regular deployments combined if it reduces the chances of something going wrong or me forgetting something and breaking something that'll take 5x as long to repair. - noin, on 10/10/2007, -0/+4You really need to learn ruby
- DanaK, on 10/10/2007, -0/+4You could probably recreate a large bulk of CDBaby in ColdFusion 8 in a week.
- Archon810, on 10/10/2007, -0/+4Deployment hell? Perhaps you should look into Capistrano. http://www.google.com/search?hl=en&q=capistrano
- jstanden, on 10/10/2007, -0/+4To blindly bash PHP developers as a bunch of copy/pasters is pretty naive. Do you deploy .NET on Mono or IIS?
As someone who has been outside the entrepreneurial womb for more than 15 seconds, it's my duty to inform you that anecdotal opinions don't lead to worldwide absolutes. You'll find another PHP programmer who can tell you with just as much deluded conviction that PHP is the easiest. It's much more about the programmer than today's tool of choice. - knotty, on 10/10/2007, -0/+4Or if Capistrano is overkill, try the awesomely named Vlad the Deployer.
http://www.rubyhitsquad.com/Vlad_the_Deployer.html - vdxc, on 09/29/2008, -0/+4So, you hate PHP because some PHP developers share their work? Is that really a bad thing? After all, if you don't want it you can write it yourself.
- caluca, on 10/10/2007, -1/+5It's so easy to get lured into a new programming language. I have stuck to PHP because I have a greate support network of great PHP programmers around me and we just have to remmember that the USER doesn't give a ***** about programming languages!
- appletalk, on 10/10/2007, -1/+5I like Symfony far better than CakePHP as an MVC framework for PHP
- oneblackcitizen, on 10/10/2007, -0/+4dugg for "How do I drag a textbox onto that?" lol
-
Show 51 - 100 of 172 discussions



What is Digg?
Check out the new & improved