I have 6 months of work done in PHP and I really don't want to re-invent the wheel but I want to use some Ruby in my site. Is it possible to "mix languages" like PHP and ruby or will I run into some major problems? I would really appreciate your opinion. If your advice is helpful to my situation I'll add to your reputation.

Recommended Answers

All 2 Replies

It's completely plausible, as long as you're not trying to mix the two into the same file (it'd still be possible, just inefficient, as it'd have to be processed twice). And, it depends on what kind of site you're trying to build. For example, if you're building a 'web-app' where a large number of your PHP scripts just return data, and are never actually 'viewed' by a user, then your life will be quite simple.

In short. No.
However, if, as noted before, you are using php files for data access, you can use pure ruby (or sinatra-like frameworks) to work with the data.
Rails will be extremely hard to mix code.
If your starting from scratch, learn ruby properly, and you won't need all that php code (if it's just crud code).
The whole idea of rails is to keep it clean, and what your suggesting isn't that clean. (would require a net://http to your own server, or using php command-line interface).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.