View Full Version : Using Rails.. then going back to PHP
rob
May 16th, 2005, 10:41 PM
Just curious.. Has anyone used Rails, then gone back to PHP for a few days, or perhaps to finish a project started in PHP? I've experienced this, and only after a short while with Rails, I felt like something was missing out of PHP.
Anyone else care to share there thoughts about this?
steve_d555
May 17th, 2005, 01:17 AM
Not exactly but I first made a website entirely in PHP then found out about Rails and made a better one in less time and less code. Although I didn't exactly feel that there was anything missing in PHP, I did feel that Rails was much, much easier to code with.
rob
May 18th, 2005, 04:26 PM
Yea.. I wish we could use PHP code in Rails apps sometimes :) I might look for a way to pull that off, if possible.
I know someone might say why would you want to do that, but for PHP developers, it would be a cruch to lean on for a bit while we learn Rails.
mserms
May 25th, 2005, 05:59 AM
I have been developing with Ruby and Rails for a couple of months only, but am probably coming to a different conclusion to most people. As a general scripting and programming language, I absolutely love Ruby. Loads.
However, for web development it just feel awkward compared to PHP. I'm quite willing to believe this is because I have programmed PHP for a few years and I'm not the best Ruby/Rails programmer ever, but I'm just not getting the huge love for Rails that everyone else seems to. There are aspects to Rails that I *really love* (being able to say something like article.author.name to get to joined tables is lovely), but a lot of stuff takes ages to work out. Annoyingly, I can't think of a specific example right now.
I'm not sure if this is a Ruby problem, a Rails problem or just me being crap and new to Rails.
Hmmm, I've just realised how negative this sounds - that wasn't the intention at all! I love Ruby and I feel I should love Rails, but PHP still feels excellent for developing sites.
rob
May 25th, 2005, 11:54 AM
mserms,
I know what you're saying. I'm still convinced that there is a need for PHP, and I do feel more comfortable in it. But look at all the "scaffolding" that we put in place with PHP to get it to do what we wanted. I'm sure most heavy PHP developers developed a set of library functions or classes for our work, and that we probably used includes to include database routines and whatnot.
My guess is, for the small projects, PHP will be the best thing. For the big ones, Ruby will be best. For things in the middle, Rails will fit the job.
Caged
May 25th, 2005, 12:09 PM
I've also been a php developer for over 4 years now, and haven't put any thought to going back to developing applications in php.
There are some Rails clones surfacing in the Php world, although I have yet to try any of them. Has anyone given Biscuit (http://ripcord.co.nz/biscuit/forum/?controller=forum&action=index) or Cake (http://sputnik.pl/cake/) a run?
ezmobius
May 26th, 2005, 11:40 PM
If you're really missing php in your rails apps you can always throw .php files in public if you have your webserver configured correctly. Then you can drop into a quick php script if you don't want to use rails for a particular part of your site. Or if you have some great php library that doesn't exist in rails yet. You could even include rails actions in your php code by doing a curl function on an url that leads to a rails controller and action. But at this point php is really just a crutch. But it seems like a totally viable way to ease into a rails site from a php'ers perspective.
burntout
September 17th, 2005, 07:27 PM
Why would anyone want PHP again? It's a horrible, ugly language! If you don't want Rails, don't use Rails, just plain .rb files using the easy, easy CGI module. PHP is undisputedly a highly inferior language.
rob
September 17th, 2005, 09:06 PM
Why would anyone want PHP again? It's a horrible, ugly language! If you don't want Rails, don't use Rails, just plain .rb files using the easy, easy CGI module. PHP is undisputedly a highly inferior language.
There still exist a great many uses for PHP, especially in smaller project-lets like contact forms, simple post to a database from a frontend, etc. Also, in doing a simple website with a header/footer include, PHP seems to work the best.
Ruby .rb's are great, but I can't stand using CGI type interfaces. That's the nice part about Rails, it handles that stuff for you.
I suppose there's always eruby too, but really, PHP fits the bill for a lot of very small things for me.
burntout
September 17th, 2005, 09:16 PM
There still exist a great many uses for PHP, especially in smaller project-lets like contact forms, simple post to a database from a frontend, etc. Also, in doing a simple website with a header/footer include, PHP seems to work the best.
Ruby .rb's are great, but I can't stand using CGI type interfaces. That's the nice part about Rails, it handles that stuff for you.
I suppose there's always eruby too, but really, PHP fits the bill for a lot of very small things for me.
You're using a "CGI type" interface when you use PHP, it's no different. Look at the docs if you don't believe me (http://www.ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html). Ruby has DB libraries independent of Rails. Erb is certanly separate from Rails like you say, and that completes the things that PHP seems to be better at. Ruby can do everything PHP can do, but it's a nice language. I'm not trying to troll, just trying to point out that Ruby doesn't have to be this (admittedly very lovely) splurging huge thing that Rails is: it can be just as compact as PHP. The only advantage is, of course, that you already know how to do all these 'little' things in PHP, so there is more reluctance to move away :)
rob
September 18th, 2005, 08:02 PM
mod_php runs as part of Apache, and therefore has better speed than any Ruby script could ever hope for, unless you're using mod_ruby or mod_fastcgi. In either event, you have to deal with HUP'ing the process if you change the file.
I'm very comfortable with PHP, but growing more and more cozy with Ruby too. I just don't like the CGI class. Erb is better, but the overhead is too high when all I want to do is mail() or include an html file IMHO.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.