
|
View Full Version : RoR versus Php
innova 10-20-2005, 12:07 PM Question for those out there that are using or have experience in both PHP and RoR.
I am currently working on a few apps using php and smarty for a templating system. RoR has caught my attention and I am reading some fantastic tutorials.. the thing that strikes me about RoR is how SMALL the apps are and how RoR helps overcome some common tedious tasks. No doubt about it, RoR is brilliant.
Has anyone here made the 'switch' from php to RoR for building their web-based applications? What were your reasons and what is the payoff?
I hesitate to learn YANL (yet another new language), and RoR has tremendous hype.. Is it justified?
I think the thing that has me most interested is how compact some of the RoR apps are in comparison to my php/smarty apps. I dont honestly believe they are much faster, as speed hasnt been an issue for me thus far. The other thing is some of the 'newer' things that RoR makes easy such as AJAX-based frontends, etc. Of course, this can all by done in php as well.. So is this RoR thing just a fad or should I be taking a serious look at picking up Ruby?
maxymizer 10-20-2005, 02:07 PM I'd just like to point out that Smarty is a bad choice for TE.
Regarding Ruby - IMO, just a hype. I have no actual need to use Ruby or RoR as a framework.
If I had/wanted to completely learn a new language I'd go with ASP.NET and not Ruby allthough it might seem interresting.
Just a thought from a guy who gave Ruby a shot. I'd like to play with it more but I can't let business suffer because I'm taking a few days to try a new language ;)
If you have time/will to learn new language - sure, go for it. But as I said - I'd rather learn ASP.NET. More $$ there :)
innova 10-20-2005, 04:04 PM I'd just like to point out that Smarty is a bad choice for TE.
Havent we gotten into this one before ?!
I use smarty because its easy and saves time. Its not the best thing in the world, but it does allow me to have no php in my .tpl files and ONLY business logic in my php files. For that, it serves well.
maxymizer 10-20-2005, 04:25 PM Hmm, you might be right that we had that discussion, I really can't recall. Also, that's not the topic here so I'll just drop discussing TE's, ok? :)
I think I ran into some PHP frameworks using AJAX, I have to check my bookmarks and I'll try to send a few.
gogocode 10-21-2005, 06:59 PM Originally posted by innova
but it does allow me to have no php in my .tpl files and ONLY business logic in my php files. For that, it serves well.
Offtopic, but this thinking really annoys me. There is NOTHING wrong with putting PHP display (visualisation/view) logic in your "templates" (echo, loops, conditions mostly). That's what PHP was designed for, that's what PHP does best, that's what is fastest.
Using a limited template "language" like Smarty does four things..
1. it makes your application do more work for the same result
2. it introduces another "language" into the mix
3. it makes more work for the programmer, not less
4. it makes it harder to using typical designer tools such as Dreamweaver to edit your templates as these tools (I'm thinking DW specifically) don't support (nativly) Smarty syntax with anything other than complete disdain, where at least they can do something useful with PHP
As long as you're not putting code in your templates that have nothing to do with the visulalisation then you are perfectly adequately providing view separation.
That said, if your template system is making *less* work for you (by automating stuff) and making it *easier* for designers to use thier faviourite tools (by providing special tags those tools understand for example), then cool, but Smarty etc, at least last I looked, don't come close.
That, and people using echo to output huge chunks of HTML are the two things that really wax my nose about other PHP developers' practices.
Dan L 10-21-2005, 07:29 PM I'd recommend doing a search at SitePoint--there are a handful of decent discussions about it going on.
Burhan 10-22-2005, 03:01 AM Please do not compare RoR with PHP, as they are not the same thing.
RoR is a framework for developing applications. PHP is a scripting language. Comparing one to the other is just a waste of your time, and frankly -- I don't see why people do it.
RoR, a framework based on Ruby, the language. For what its worth, there are tons of frameworks in PHP that deserve your attention.
What is more, Zend is starting a new initiative to form a standardized framework for building web applications in PHP (just like ASP.NET is a standard framework for building web applications using .NET languages).
I think the reason why RoR is recieving so much web-time these days, and is on the top of everyone's list of "things I must know and talk about" is because it brought to the light (in a very dramatic way) what a good framework can do to a development process.
I believe that if you were to take some time and learn (or develop) a framework, and most importantly stick with it you will see the same benefits as RoR.
As far as AJAX is concerned, this is nothing new -- just a 'buzzword' given to a method of facilitating client-server communication; and as anyone that is a seasoned web developer will tell you, is not some exotic magic wand, but rather something as simple as initiating a request using the (now matured and well-supported) javascript capabilities of browsers.
Now to your question about 'have people jumped the wagon' I would say the answer is no -- simply because other than the original developers of the RoR framework, I haven't seen any other applications developed using the technology.
Finally, it does not make good business sense to jump into unknown waters with what is a very new language, and develop a business-critical application with it. Especially since there is a lack of commerical support for it. Heck you will have a hard time to find many web hosts that support RoR. Believe me, when it comes to business, the level of vendor support is a very big factor in deciding on the technology to use for developing applications.
/me gets off the soapbox now.
gogocode 10-22-2005, 04:51 AM fyrestrtr speakath the truth.
Rails is a framework, nothing more, nothing less. You can compare Ruby to PHP if you like, but if you're talking about Ruby+Rails then you have to add a similar framework to PHP as well.
There are many to choose from, and of course most developers worth thier salt have written thier own (at least once!) over the years.
Froggy 10-22-2005, 08:29 AM Finally, it does not make good business sense to jump into unknown waters with what is a very new language,
Ruby came out in 1993, before PHP. But I assume you were talking about RoR (?) eventhough you tried to hammer the point that its a framework not a language.
sasha 10-22-2005, 12:20 PM Few weeks ago I saw couple RoR presentations. I was very much imnpressed with the amount of effort and thought that went into this framework. Very cool thing was that there is very little of difference between RoR and my own PHP framework which took years to develop. Even though I liked what I saw I would not recommand someone just jumping in and starting using this before you spend time learning how framwork itself was built.
deuce868 10-22-2005, 12:41 PM The coolest things about ROR is that the whole environment is setup for it. The web server, scripts, everything. PHP is not this way because apache is not tied to php and such.
That is also my concernt though, I put large scale projects on php/apache/postgres and all is well. I trust the stability of the system and I don't currently have that kind of faith in a ROR system.
extras 10-22-2005, 04:47 PM Personally, I think both PHP & RoR as "hype".
And they are not really good for people using shared host.
When used as CGI, they are slow and eat lots of memory.
With mod_php or fastcgi, I'm not sure about the security issue.
sasha 10-23-2005, 10:57 AM Originally posted by extras
Personally, I think both PHP & RoR as "hype".
I am not sure how you can after all the other posts in this thread still compare PHP and RoR. RoR is just web development framework built on Ruby (very very pretty language). In PHP world there is no RoR equivalent or maybe there are thousands of them. Because of the nature of PHP, every serious developer has his own "PoR".
And they are not really good for people using shared host.
When used as CGI, they are slow and eat lots of memory.
With mod_php or fastcgi, I'm not sure about the security issue.
Regarding mod_php, on shared or dedicated host security of php application is in hands of developer. Once when you have your PHP development framework setup it has to include security considerations. If you keep your SQL password and username in plain text files readable by "nobody", or if your files can be read or included by other users on the same host, you cannot blame PHP for that. PHP provides for simple mechanics to avoid all of that it is just simple matter of learning how.
extras 10-23-2005, 11:35 AM Originally posted by sasha
I am not sure how you can after all the other posts in this thread still compare PHP and RoR. RoR is just web development framework built on Ruby (very very pretty language). In PHP world there is no RoR equivalent or maybe there are thousands of them. Because of the nature of PHP, every serious developer has his own "PoR".
Yup. And both language and framework can be "hyped".
I think some people who have been riding on the hype of PHP are starting to realize that PHP is slow innefficient badly implemented language (for a shared hosting environment).
Somehow, they are looking at RoR as the next thing to worship.
That's the impression I get observing several forums.
Regarding mod_php, on shared or dedicated host security of php application is in hands of developer.
Well, the big difference is you are harming yourself (mostly) on dedicated server (or VPS), while you can harm thousands of others on shared hosting.
Once when you have your PHP development framework setup it has to include security considerations. If you keep your SQL password and username in plain text files readable by "nobody", or if your files can be read or included by other users on the same host, you cannot blame PHP for that. PHP provides for simple mechanics to avoid all of that it is just simple matter of learning how.
One reason why I see PHP as a "hype" is many of PHP users simply refuse to admit any negative aspects of PHP.
I mean, these peolpe are not using it after examining the merits and short comings.
And I see similar tendency among RoR worshippers.
(Maybe less than PHP people, though)
Although I have no objection about any personal belief,
PHP/MySQL hype is costing lots of money in the shared hosting industry, I think.
And I'm not sure at all if RoR will do well in the biggest segment (as far as the number of users is concerned) of the hosting industry.
maxymizer 10-23-2005, 01:55 PM One reason why I see PHP as a "hype" is many of PHP users simply refuse to admit any negative aspects of PHP.
Every language has negative aspecs. PHP is no exception.
Also, even if it were hype, some of us make a living out of that hype ;)
extras 10-23-2005, 02:03 PM Originally posted by maxymizer
Every language has negative aspecs. PHP is no exception.
Also, even if it were hype, some of us make a living out of that hype ;)
Indeed. PHP is a well profitable hype for many people. :)
And you have advantage of riding big hype than smaller one.
Burhan 10-24-2005, 02:44 AM Ruby came out in 1993, before PHP. But I assume you were talking about RoR (?) eventhough you tried to hammer the point that its a framework not a language.
In terms of businesses, both Ruby (the language) and RoR are very new; as there has been no serious exposure (advertising, marketing, etc.) for either of them to the business environment.
rplholdings 11-08-2005, 04:51 PM I was wondering what frameworks for PHP are there? I know of LAMP, but what are other popular frameworks, and how would you "build your own"?
innova 11-08-2005, 05:39 PM I know of LAMP, but what are other popular frameworks
LAMP isnt a framework in the sense that RoR is to Ruby or CakePHP is to PHP. LAMP is really more of a platform than a framework.
Burhan 11-09-2005, 01:40 PM LAMP is not a framework, its an acronym that stands for :
Linux Apache MySQL PHP
Some frameworks for PHP:
Prado (http://www.xisc.com/)
Propel (http://propel.phpdb.org/wiki/index.php?node=11)
Phing (http://phing.info/wiki/index.php) (not really a 'framework' per se, but worth a look)
Creole (http://creole.phpdb.org/wiki/)
Mojavi Project (http://www.mojavi.org/)
There are tons of others.
|