views:

622

answers:

16

This is not meant as a slam on php. I use it frequently.

Just curious though, has anyone "moved on" from php to use ruby or python as their primary scripting language, then "come back" to using php?

A: 

Yes. Python is amazing and I'm considering getting back into it, but the indentation is a pain for my particular style of indenting code.

Ruby was also amazing and I had a fun little fling with it for a while until I realized that if(0 && 10) evaluates to true. I just can't abide that in a language.

In all seriousness, though, both are great languages but this is a very subjective question and every reply you'll get will pretty much be someone's personal opinion.

Max
FYI, `if 0` evaluates the true branch too. Everything is true except false and nil (null).
Jules
+12  A: 

I tend to think of each language I learn as a useful tool in the toolbox - once you're good with PHP it isn't really a case of going back to it as using it for jobs where it is the appropriate tool. Particularly for smaller scale web stuff, it's ubiquitous, it's easy to write and host and PHP programmers are easy to find so customers find it reassuring.

There are a lot of other situations where I would prefer not to use it, but I certainly go back to it from time to time if someone I'm working with needs it.

Most code is ultimately legacy to some degree anyway so the biggest restriction is usually what the existing project was created with.

glenatron
Although it's always good to be familiar with many web technologies/languages. +1
Kezzer
+4  A: 

Yes. I love Python, but web programming 'requires' PHP. Especially at work. Django is on the way up, though, but PHP is still more performant than mod_python.

Adriano Varoli Piazza
The comment about mod_python is true, and it's still true with mod_wsgi, but a bit better.
Matthias Kestenholz
+5  A: 

I moved on from PHP (used it in college for personal websites) to ASP.NET (for a company that was on a MS stack). For me the best part of the move was the VS IDE and the static-typed nature of the C# language.

No, I wouldn't go back if I had the choice.

Giraffe
+6  A: 

I think PHP is still an excellent language, and the fact of the matter is that it's still being heavily developed where we're now moving into PHP 6. The changes made to the core language have been major, especially with the introduction and improvement upon Object-Oriented fundamentals.

I'm a professional .NET developer, but when I'm at home I always go back to PHP for my work. I also use Python at work and couldn't fault it. It's an excellent language, and fast too.

Overall though I don't think there's anything wrong with using a language like PHP, it's a good of a language as any other and has an active (and large) community improving the language and its features every day.

Kezzer
A: 

I played in Ruby on Rails for a while, but returned to PHP.

ceejayoz
I bet you found you wrote your PHP different afterwards though?
glenatron
Not significantly, no.
ceejayoz
A: 

I moved on from PHP a long time ago onto Ruby but I still use PHP everyday at work and because of this I know what to use when. PHP is still a brilliant language; it's fast, forgiving and used everywhere. As Kezzer mentioned PHP is still being developed to allow more of what everyone is using. Example. PHP 5.3 (I think it's this next version) allows for closures and anonymous functions which allows it to do a lot more things now.

stuartloxton
Especially if you look at the background of PHP and where it came from. It really doesn't surprise me that PHP has gone the way it has done, and how it's now improving so dramatically. A recent PHP book I've been reading delves into the history of PHP, and it was very much a test language only.
Kezzer
+1  A: 

Also bear in mind that many programmers' work are driven by the customers' requirements and/or the need to use tools that the rest of the company's programming staff are familiar with. A free language choice is not always an option for many.

Cheekysoft
+3  A: 

I used to program in PHP. But PHP as a language has serious flaws, and the library is a mess, so I moved on. I use Ruby on Rails for web programming now, and sometimes Django. These tools are a lot better, so I never looked back.

The only advantage PHP had for me a few years ago was that many webhosts supported it, but there are enough Rails hosts now.

Jules
Can you compare PHP to Ruby on Rails or Django? Wouldn't the comparison need to be Cakephp/Symfony/Zend framework to rails or django?
simplemotives
You can, both are tools to create websites. You can also compare Cakephp/Symfony/Zend to Ruby on Rails, but that wasn't a comparison I could make at the time (these PHP frameworks didn't exist). I did try Cakephp, but didn't like it. Because PHP is less powerful than Ruby they had to insert ugliness into the framework.
Jules
A: 

I am perfectly happy using PHP within a framework, specifically Drupal, because the style constraints and functions provided by Drupal turn PHP into quite a nice way to build functionality inside the which takes care of a lot, and has the advantage of being easily deployed to most hosting providers. It's the classic idea of programming "into a language", ,code that makes it into Drupal must meet some quite rigourous requirements, and in the end PHP's messier side doesn't come back to bite you as it can when you are building from scratch.

alxp
A: 

I'm being tempted now. Drupal seems like a good CMS, and it's based on PHP. Anyway, nowadays I tend to think the real "action" in web apps happens on the client. The fun stuff is really grokking CSS and jQuery for me now.

Dave Markle
+3  A: 

"7 reasons why i switched back to php"

http://www.oreillynet.com/ruby/blog/2007/09/7_reasons_i_switched_back_to_p_1.html

I.devries
I don't think that that anecdote offers enough evidence to make a decision on, given the strong claims the author is making.
Dana the Sane
The poster doesn't ask for evidence, he's just curious if anyone ever switched back to php and why. I think this article fits perfectly.
I.devries
A: 

I have a love/hate relationship with PHP- I started web programming with it and liked how quick and dirty it was. Then I started working with Java and I realized most of the big flaws in PHP.

However, I still go back to it for minimal (around 5 different HTML pages or less) web stuff, such as:

  • Simple glue (i.e. show a form, process the form values, feed them to an external process, display results)
  • Mock-ups
  • Simple form collection (email forms, etc.)
  • Minimal templating (I know I should use server-side includes, but more people are familiar with PHP)

Nothing beats creating a folder in a web server and starting writing a few PHP files, ramp-up time is nearly zero.

However, as soon as you run into PHP's flaws, you should consider alternatives, quickly.

alex
A: 

I am moving back and forth between PHP and .NET but since I sell VS.Php which is an Addon for Visual Studio I really don't have an option not to use it ;) PHP is great language - if you use a good Framework with it. Its really fast to develop which I find harder in other languages. Especially I find it interessting that developing desktop applications via Adobe AIR/Titanium has become really easy as a webdeveloper.

Thomaschaaf
A: 

I've switched back from Java. Well, really, I stopped working on the project that use Java, which was 80% of my time.

I've returned to project that happen to use PHP. Maybe that isn't fair to either Java or PHP. But I did get off the other project, partially because of Java.

Jeff Warnica
A: 

Demonstrating that this sort of thing is often dictated by your environment more than your preferences, I'm starting to use PHP now. I primarily used Python in my last job. For me, this is not exactly "going back" to PHP, since I had never done it before. However, PHP is a requirement for the new job (which was an internal transfer). In the little exposure (a couple months of limited study) I've had to PHP thus far, I think it's okay, but would prefer Python.

PTBNL