tags:

views:

316

answers:

5

I know that this is a difficult question to answer, but I thought I would try anwyays....

I am just starting at a new company where they have a minimal existing code base. It probably has a month of man effort invested at this point. It is currently written in Ruby.

It is also currently using Ruby on Rails -- but mostly just for the sake of testing out the Ruby code.

The ultimate goal of the code is actually to drive a backend to a site that will be written in php (could be a backend to Drupal, Echo, etc...).

I have no experience with Ruby, so I would tend to want to go with a language I know better (like Python), but am not willing to rule Ruby out for no reason.

If you are not going to use Ruby for a Rails project, is it still worth it? Will I be better off going with Python or some other language?

How do the libraries stack up?

Thanks!!!

A: 

Rails apps can potentially make a great REST backend for a php based system.

The REST stuff is made for it. You want xml? ok. You want json? ok.

If you and the staff aren't comfy with it, use something you are more comfy in to write a REST interface. :)

Chad Ruppert
A: 

Why wouldn't you just keep it consistent and use PHP?

ryeguy
`<snark>` What's consistent about PHP? `</snark>`
Chris Lutz
I find way to many people defaulting to "bad stylistic" behavior with php. This has led to way too many bugs for no good reason. Not to mention it is hard to find many people using php for any standalone scripting if it is not web based. (The backend we are developing is really mean to be a separate system).
Hortitude
It's perfectly possible to write bad, nay, horrible, code with Ruby (or Python), too...
Peter
So true. though while it is possible to write bad code in say Python, I feel that the language "pushes" you more towards good code while php "pushes" you more towards bad...
Hortitude
Doesn't Erb already feels like PHP on the view side? If you go Rails, you might feel the PHP within while coding the template.
Thierry Lam
A: 

IMO, if you're comfortable with Python then you shouldn't have too much trouble picking up Ruby. This doesn't mean Ruby is the best choice - you should still evaluate the options.

Artelius
Any thoughts about what is the best choice?
Hortitude
Consider it this way: would the time you save by using the existing Ruby be less or more than the time it would take you to learn Ruby? Ruby's a good language to know... I recently changed my allegiance to Ruby, from Python.
Peter
I don't know enough about your situation to say very much. Rails works very well in "I can't tell you whether I want it until I see it" situations, where you want to be able to add new features and change/remove old ones quickly and easily, and you don't care too much about how the features are actually implemented. It may not work well if you already know what you want, and you know how you want it to be implemented.
Artelius
+1  A: 

Ruby Madness. Sure, it seems cool, but it might lead to the hard stuff: Lisp


My predictions:

  1. It's pretty clear that you are OK with either Ruby or Python, and obviously php can be made to work.

  2. You will really like Ruby.

I'm a little bit worried that after Ruby the only place left to go will be Lisp, and that I will become one of those raving lisp maniacs with bad haircuts waving my arms and muttering about The One True Macro Processor.

DigitalRoss
I second the prediction that you will like Ruby.
jrhicks
+7  A: 

My advice would depend on your own goals, which might look like this... you might want to ask yourself (or score each of these from 1-10) if you prefer to:

  1. learn a new language you might use in future? = Ruby
  2. deepen your Python skills by using it for everything (say Django or Web.Py) = Python
  3. move the Ruby testing away from Rails = Ruby

Other questions you could ask yourself to help the decision might be:

  1. is speed important? Do some tests in the various languages. (If Ruby, then use Ruby 1.9 and get the other Ruby book).
  2. is integration important? If so, why use a PHP front end?
  3. is your connection to the language community important? If so, choose on 'community feel'.
  4. is there a lot of backend text processing? (Perl?)
  5. do you want to use an ORM or write SQL? = look at Ruby and Python lightweight frameworks.

I don't think the libraries will be an issue, since (I'm pretty sure that) libraries for popular languages cover all common tasks.

If you can score all the above from 1-10 it may help isolate a preferred direction...

Then, as I see it, the issue breaks down into 3 things:

  1. what language do you most like to code in (work should be enjoyable)?
  2. can the front end and back end be generated in a single language?
  3. do you want to use a framework or a ready-made CMS for the front end?

It's worth looking at the origins of languages: PHP was originally announced as an extension of SSI, Ruby tries to take the best of Perl, Smalltalk and Lisp but has elements of a C/Java-like syntax, Perl is intimately connected to Unix and everywhere, although usually invisible to end users (despite some very good Perl web frameworks). You already know about Python.

As for frameworks and CMSs, a trawl through the distinctions/limitations/features might also help. It is too easy to install a PHP CMS (fine for a site with a well-defined purpose) but then find yourself hampered in acres of impenetrable code when you want do do something it can't do out of the box. A framework in the backend language will enable you to hook the back and front ends together more easily.

Dave Everitt