Hortitude
Hortitude

Reputation: 14048

To Ruby or not to Ruby

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!!!

Upvotes: 1

Views: 587

Answers (6)

Bernhard
Bernhard

Reputation: 705

Using Ruby für two years now , i find it powerful, easy to learn, having good libraries, good community.

But how should we know if it fits your needs? Try it an you will find out.

Upvotes: 0

DigitalRoss
DigitalRoss

Reputation: 146043

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.

Slightly more seriously, though Lisp and Smalltalk are still in tiny niche spaces after 60 and 40 years, it turns out that the child of the two bore fruit. Various Lisp and Smalltalk hackers are starting to show up speaking about their child Ruby at Ruby and Rails cons. As it happens, Ruby (timeframe 15 years) has quite a bit of the Lisp and Smalltalk magic.

And, to this party, Ruby brings about every single bit of the day-to-day and 3-line-script usefulness of Perl. Ruby is an explosion on the language scene that combines the scripting superpower of Perl with the object-orient superpower of an exotic language like Smalltalk.

Ruby is an awesome and groundbreaking language with or without Rails. I say, drink the kool-aid.

Upvotes: 4

Dave Everitt
Dave Everitt

Reputation: 17846

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.

Upvotes: 7

Artelius
Artelius

Reputation: 49078

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.

Upvotes: 0

ryeguy
ryeguy

Reputation: 66851

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

Upvotes: 0

Chad Ruppert
Chad Ruppert

Reputation: 3680

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. :)

Upvotes: 1

Related Questions