views:

564

answers:

5

I am a .Net / SQL Server developer via my daytime job, and on the side I do some objective C development for the iPhone. I would like to develop a web service and since dreamhost supports mySql, python, ruby on rails and PHP5, I would like to create it using one of those languages. If you had no experience in either python, Ruby on Rails or PHP, which would you go with and why? The service basically just takes a request and talks to a MySql database.

Note: Was planning on using the SOAP protocol.. though I am open to suggestions since I have a clean slate with these languages.

+4  A: 

Ruby-on-rails, Python and PHP would all be excellent choices for developing a web service in. All the languages are capable (with of course Ruby being the language that Ruby on Rails is written in), have strong frameworks if that is your fancy (Django being a good python example, and something like Drupal or CakePHP being good PHP examples) and can play nicely with MySql.

I'd say that it would depend mostly on your past experience and what you'd be the most comfortable with. Assuming that you're developing C# on .NET and have experience with Objective-C PHP may be a good choice because it is most certainly from the C family of languages. So the syntax might be more familiar and a bit easier to deal with.

I'm a PHP developer so I'll give you that slant and let more knowledgeable developers with the others give theirs as well. PHP is tightly integrated with Apache, which can make some of the more mundane tasks that you'd have to handle with the others a bit more trivial (though when working with a framework those are usually removed). The PHP documentation is second to none and is a great resource for getting up and going easily. It has decent speed and there are good caching mechanisms out there to get more performance out of it. I know that getting up and running with PHP on Dreamhost is trivial. I haven't done it in the other instances although it wouldn't surprise me if those were just as easy as well.

I'd suggest digging a bit more into the documentation and frameworks for each language to find out what suits you best.

codeincarnate
+2  A: 

I have developed in Python and PHP and my personal preference would be Python.

Django is a great, easy to understand, light-weight framework for Python. Django Site

If you went the PHP route, I would recommend Kohana. Kohana Site

sberry2A
I do not understand how this answer relates to the problem at hand (re: web service)
Randell
A: 

This is an extremely subjective question, and even if you gave us the specifics of your web service, we can argue about the best choice all day.

I'm a PHP developer, so I could whip off a basic web service with no problems. There's lots of simple PHP frameworks available that would handle that very nicely.

That being said, Python and Django give you some great out-of-the-box functionality, and it's on my list of things to learn. You could achieve something pretty fast with that.

zombat
+3  A: 

The short answer is, I'd go with PHP.

I have some experience in all two of your three choices: PHP, Ruby with Ruby on Rails. If I had no experience however and I was looking to set out and create a web service that largely just interacts with a database and I wanted it done this weekend, I'd choose PHP. If I had no experience with any of the above languages and I wanted to project done in a couple of weeks, I'd choose rails. I personally have much less experience with with Python and Django so I can't really comment.

Ruby with Ruby on Rails: I've been working with Ruby and ruby on rails for several years now. I previously had experience in Java (which is roughly analogous to your experience in .Net). I found the transition to rails to be a little bit bumpy. I wanted to jump right in and start understanding how rails works and how to build a web application but with no understanding of ruby this was difficult. There are a lot of example out there that will help you build an application quickly but often times the quickness comes at the expense of understanding. To build solid rails web application you need a good understanding of ruby and of the rails frameworks. Rails is fantastic, but for building something you understand and getting it up and running quickly it may not be your best choice. Also, rails hosting has come a long way (you can tell because we're starting to see many hosts offer it) but there are still some bumps.

PHP: PHP is fantastic for getting something up and running quickly. You can upload files and immediately see if your result if working. If you keep your database setup clean (and it sounds like you will, because you work with databases all day) the PHP shouldn't be too bad. I would look into an Object Relational Mapper to help keep your PHP even cleaner, I've heard good thinks about Doctorine.

Python: I would imagine that you'd probably use Django with Python. Because of this you're probably going to come up against the same stumbling blocks that you would with ruby + ruby on rails.

If you'd like to start to learn Ruby on Rails, I'd recommend checking out this thread on stackoverflow.

Finally, if you'd like to work with a PHP framework, there's a great thread on that here on stackoverflow.

nixterrimus
Thank you, very good insight.
Codezy
Django learning curve is not that steep. The docs is excellent.
jpartogi
A: 

The first programming I ever did was with PHP, and it's definitely very easy to get going with PHP on Dreamhost (I use Dreamhost for my PHP-based blog as well as Ruby on Rails project hosting). Ruby on Rails is pretty easy to get going on Dreamhost as well, now that they've started using Passenger. I learned Ruby and Ruby on Rails several years after I became comfortable in PHP and I prefer it to PHP because it feels much cleaner and I love the Model View Controller pattern for separation of code and content. I tried to learn Django after that but found myself frustrated because the meaning of "view" was different in Django than in Rails/MVC, so I didn't get very far.

If you are doing quick-and-dirty, you might go with PHP. You could look into various frameworks for PHP, such as CakePHP or Symfony, for cleaner, more organized development. If you're willing to spend more time learning (first for the language Ruby, then for the framework Ruby on Rails), you could go with Ruby on Rails. I really enjoy Rails development, but there was a learning curve since I learned both Ruby and Rails at the same time. There's a lot of information out there about deploying Rails apps on Dreamhost.

Sarah Vessels