Will Rails be the new PHP(roytomeij.com)
roytomeij.com
Will Rails be the new PHP
http://roytomeij.com/2012/will-rails-be-the-new-php.html
12 comments
I dont think so. Having migrated to Ruby and Rails from PHP there are a number of compelling differences that will avert the gloom and doom the author seems to mention:
* Rails is driven/maintained by really high quality developers who adhere to best practices
* The project is well-organized, opinionated and focused, developers tend to follow the one right way of doing things.
* The Rails Ecosystem of gems and plugins has whole gamut of solutions to various engineering problems. These gems vary from excellent to horrible, with the excellent ones floating to the top and become standard for use.
* Rails encompasses best practices that were learned from years of making mistakes with PHP and Java development. It is that much more evolved as a result.
In general, I would say the main difference is Rails seems more top down in the direction of ideas and best practices. People tend to mold themselves and their code to fit with the best practices displayed by core or by seasoned Ruby developers.
PHP on the other hand seems more like a free for all, with little top down influence at all.
* Rails is driven/maintained by really high quality developers who adhere to best practices
* The project is well-organized, opinionated and focused, developers tend to follow the one right way of doing things.
* The Rails Ecosystem of gems and plugins has whole gamut of solutions to various engineering problems. These gems vary from excellent to horrible, with the excellent ones floating to the top and become standard for use.
* Rails encompasses best practices that were learned from years of making mistakes with PHP and Java development. It is that much more evolved as a result.
In general, I would say the main difference is Rails seems more top down in the direction of ideas and best practices. People tend to mold themselves and their code to fit with the best practices displayed by core or by seasoned Ruby developers.
PHP on the other hand seems more like a free for all, with little top down influence at all.
Find/Replace "rails" with "Symfony" and you'll have the PHP equivalent. Also, "bundles" instead of "gems". This is why PHP negativity has been increasingly misguided for the past 2 years.
most of the PHP devs i know write raw PHP. they do not use a framework. one team built their own (4 years back). And NONE of them wrote tests. Actually i have never seen or heard any php dev writing and evangelizing tests
In ruby, mostly everyone i know, uses rails and mostly everyone writes some test. either TDD or after writing the code.
It is not as bad as PHP but personally even for me, i should write better rails code
In ruby, mostly everyone i know, uses rails and mostly everyone writes some test. either TDD or after writing the code.
It is not as bad as PHP but personally even for me, i should write better rails code
That's exactly the point I was making. Symfony developers are similar batch of developers like you see with Rails - writes tests, utilizes frameworks/components, very active in open-source.
Any developer, PHP or otherwise, that knowingly ignores contributions within the community is dangerous :)
No matter what language you use, you can always write better code, even with PHP!
Any developer, PHP or otherwise, that knowingly ignores contributions within the community is dangerous :)
No matter what language you use, you can always write better code, even with PHP!
Can you give examles of these "best practices"?
check http://www.amazon.com/Rails-AntiPatterns-Refactoring-Addison...
other than that, 1. write tests 2. good community. for some measure of good
other than that, 1. write tests 2. good community. for some measure of good
I think this article makes a really really bad comparison. With both Ruby and PHP, there are many ways to write something terrible (especially with Ruby's more than one way to do one thing Perl philosophy). However with Rails being an opinionated framework, there is typically one really publicized opinionated way to do one thing (ala Python style). With the opinion coming from good developers, I don't see quality going down anytime soon if newbies just follow it. To add to this, a lot of good ruby coders tend to do educational blog posts, which really helps out the community. Compared to the other language communities I've experienced (python, java, perl, and php), I think Ruby does the best on the education front. For now, it's what gives the language its edge.
However with Rails being an opinionated framework, there is typically one really publicized opinionated way to do one thing (ala Python style).
Perhaps so, but as with Python that way changes over time.
Perhaps so, but as with Python that way changes over time.
Staying on subject - does it matter, as long as that evolved way remains a reasonable and good way to develop?
I started with Rails 2.x, and I did find it painful to transition to Rails 3.x after a few years of not using it. In the end though, I find myself really liking the decisions made for Rails 3.x. It's helped my productivity a lot.
I started with Rails 2.x, and I did find it painful to transition to Rails 3.x after a few years of not using it. In the end though, I find myself really liking the decisions made for Rails 3.x. It's helped my productivity a lot.
>Does it matter . . .
To you, no; to me? No.
The same thing happened to me: Rails 3 came along. My web applications weren't so large that the port would be unreasonable, so I gritted my teeth and came out feeling like I had gained something. (Knowledge, experience, productivity.)
---
For every "you", however, there is someone with a non-trivial Rails 2.x codebase that simply won't invest the time or energy to port it. So they'll keep using it; keep developing libraries for it, keep patching it, etc.
Continue this trend, and I'd imagine you end up with something like the Python2/3 schism.
For an example of what this leads to, look at Rust.
Arch Linux uses Python 3 as the default for /usr/bin/python, Rust (0.3 and it looks like 0.4) fails to compile because LLVM can't stand Python 3. [This is described in the Rust 0.4 release notes. Of course the fix is a simple symlink and an EXPORT= away once you install Python2.]
So you end up with _new and exciting projects_ that require you to install and maintain old tools and libraries. Why? Because eventually _a non-negligible_ number of library maintainers stop trying to hit a moving target.
I'm not saying Rails will _necessarily_ go down that road; but Python has already been there, and the Python 2/3 schism isn't pretty. It's a possibility worth entertaining, anyways.
To you, no; to me? No.
The same thing happened to me: Rails 3 came along. My web applications weren't so large that the port would be unreasonable, so I gritted my teeth and came out feeling like I had gained something. (Knowledge, experience, productivity.)
---
For every "you", however, there is someone with a non-trivial Rails 2.x codebase that simply won't invest the time or energy to port it. So they'll keep using it; keep developing libraries for it, keep patching it, etc.
Continue this trend, and I'd imagine you end up with something like the Python2/3 schism.
For an example of what this leads to, look at Rust.
Arch Linux uses Python 3 as the default for /usr/bin/python, Rust (0.3 and it looks like 0.4) fails to compile because LLVM can't stand Python 3. [This is described in the Rust 0.4 release notes. Of course the fix is a simple symlink and an EXPORT= away once you install Python2.]
So you end up with _new and exciting projects_ that require you to install and maintain old tools and libraries. Why? Because eventually _a non-negligible_ number of library maintainers stop trying to hit a moving target.
I'm not saying Rails will _necessarily_ go down that road; but Python has already been there, and the Python 2/3 schism isn't pretty. It's a possibility worth entertaining, anyways.
You have good and valid points that I agree with, I was just arguing was from the standpoint of "Rails / Ruby becoming another PHP"
> I'm not saying Rails will _necessarily_ go down that road; but Python has already been there, and the Python 2/3 schism isn't pretty. It's a possibility worth entertaining, anyways.
I feel the Ruby community is different from Python's. I think people who work with Ruby and/or Rails like new toys and they are willing to adapt in order to keep playing. If anything I feel the bigger danger is for Ruby devs migrating to nice shiny toys that node.js has to offer.
> I'm not saying Rails will _necessarily_ go down that road; but Python has already been there, and the Python 2/3 schism isn't pretty. It's a possibility worth entertaining, anyways.
I feel the Ruby community is different from Python's. I think people who work with Ruby and/or Rails like new toys and they are willing to adapt in order to keep playing. If anything I feel the bigger danger is for Ruby devs migrating to nice shiny toys that node.js has to offer.
If you consider the majority of new web projects are being made in Rails rather than PHP, I think the comparison applies.
I think the panorama is more diverse nowadays though. Back in the day, you basically had PHP or ASP (with Windows hosting being more expensive), and only higher-end hosting had the option for CGI. Now it's more like an equal split between PHP, .NET, Java (all frameworks), Rails, Python, et all.
I think the panorama is more diverse nowadays though. Back in the day, you basically had PHP or ASP (with Windows hosting being more expensive), and only higher-end hosting had the option for CGI. Now it's more like an equal split between PHP, .NET, Java (all frameworks), Rails, Python, et all.
Will $framework be the new $language?
Fairly apple and pears comparison and somewhat pointless.
PHP is somewhat unusual in the extent to which things normally reserved for frameworks are included in the language. For example, PHP comes with a template language. It isn't so unreasonable to compare these facilities to analogous ones provided by frameworks.
PHP has a large number of frameworks that serve the same purpose as Rails. I'm fond of both Rails and CakePHP, and while there are differences between the two, talking about how "Ruby" avoids messy code by forcing MVC onto people but "PHP" doesn't is silly.
The existence of (say) CakePHP does not affect my point, which is that core PHP includes a lot of facilities that in other languages are part of a framework written by a third party, such as a template language.
One very small example of why I don't see a correlation:
https://github.com/oscardelben/words-about-code/blob/master/...
https://github.com/oscardelben/words-about-code/blob/master/...
Original article has a question mark at the end of the title, making it easier to ignore.
really, do we have to beat this horse to death every single time?
There are bad coders in ever language/platform....and coupled with that, we all have days when we write bad code. The size of the community has very little to do with it I think.
[deleted]
Previous discussion http://news.ycombinator.com/item?id=4592865
The follow ups and updates and TL;DR are beginning to rival the article in word count.
I'm not sure what this is a sign of, but I find it hilarious.
I'm not sure what this is a sign of, but I find it hilarious.
Everybody knows that PHP is infected with bad programmers 'cause is an easy to run language.
You have a mac? Just make a .php and you can kill some baby seals with you lame code.
You are making yourself sound like a Rails fanboy with little to no real knowledge of PHP.
I'm a PHP developer (damn, this sounds like I only use PHP, but it's my favorite one). I really like PHP, it's easy to learn, easy to deploy, probably one of the most documented language. But let's be honest, all this easy stuff brings people with poor or no knowledge. Probably if ruby or python were easy as PHP to deploy, we probably would see lame ruby and python code too
OS X comes with Ruby and Python preinstalled as well.
Rails pretty much forces you into using good practices, where as PHP (without a framework) allows you to do all kinds of stupid shit.
If anything, new devs going straight to Ruby on Rails will actually give us less shitty developers.