Introducing Rails into a PHP shop? Or build up what we already use?
Asked Answered
H

3

12

Here's the setup at our shop:

  • 1 VERY large PHP app (Kohana 2) with many dev's and lots of infrastructure
  • Multiple (4-5 and growing) small PHP apps with 1-2 dev's working on these

Issues:

  • no testing
  • no documentation
  • a fragile and tedious deployment process

I'm being moved from the single large app over to the side of the house with the multiple smaller apps. The lack of testing and a proper deployment process in our shop makes me nervous that I'll spend more time fixing bugs and deploying fixes than actually writing code for new features.

Solution A:

  • Introduce PHPUnit and Selenium
  • Move us over to Phing and Dbdeploy

Problem with A: Setting up PHPUnit has been relatively easy, but functional testing with Selenium has been a total pain. Our VM's work great for dev, but Selenium pegs the needle, plus a few simple tests take forever. I don't doubt I could get all of these technologies playing well together, but it all seems like a mess and the complexity of these working together seems fragile.

Solution B:

  • Switch to Rails
  • Use integrated testing and/or Rspec/Cucumber (integration of the latter seems simple)
  • Use integrated DB migrations
  • Use Capistrano for deployments

Based on the major issues of testing, I began to look into Rails. Based on the nature of these other sites we manage, I think Rails may be a good solution. Built-in testing, great community, lots of great tools, and fast development.

Problem with B: Every app we have right now is on Kohana 2 (PHP framework) and no one in the organization knows Rails. The downside to introducing a new technology would be fracturing the teams. If I migrate the sites to Rails, then get hit by a bus, we're kind of screwed.

Bottom line:

Based on our pain points (deployments, testing, documentation, DB migrations), is it worth the cost to switch to Rails? Or should we stay put in Kohana and continue to try and get the other tools built?

Any suggestions? Anyone gone through anything similar? Management has already told me that they're open to hearing about Rails and simply want to use the best tool possible -- whatever that is. Our lead architect, however, will need some convincing if I decide to switch frameworks on our smaller projects.

Hype answered 1/12, 2010 at 2:45 Comment(9)
@closers: Just because you've got nothing to say about this problem doesn't mean it is too subjective and argumentative for some folks who have been stuck in similar situations to give helpful answers.Cora
In my oppinion it is exactly this kind of questions that make SO more than just a 'sendmetehcodez' forum. With questions like this, everybody can learn about the complexity of higher level meta decisions, etc.Cora
@closers: if I need to edit my question, please let me know. I think this is an incredibly complex decision and I think one that many other developers have (or will) come across.Hype
I voted to close because nobody can know what's better for you. I think a better question is simply: "how can I introduce testing into this PHP/K2 app?" and leave the Rails migration out of the question. After people give you solutions, you should be able to sit down and analyze the costs involved with it and see if it's cheaper than migrating to Rails (which you should already be able to analyze without our help).Substructure
@konforce -- I already know how to introduce testing into our existing apps. The question I'm asking is the one you presume I should be able to answer on my own. Is it worth it to switch frameworks in order to reap the benefits of integrated testing and better tools -or- is the cost of switching so high that I should simply try to build on what we already have despite the issues I mention above? Does that help clarify? If I was able to analyze this w/o help, I wouldn't be here. :)Hype
@jmccartie, Well, I think that general question is very subjective ... or at least impossible to give you a useful answer without knowing all sorts of things about the project and the business, which is why I suggested asking some specific question that can be beneficially answered with authority. As is, some people will answer "yes" and some will answer "no" ... and both sides basing it on real world experiences. I've rewritten projects and been glad I did, but I've also at times kept supporting 10 year old projects despite that parts of them drove me crazy.Substructure
This is subjective, but it is still something that many other people are starting to consider so I don't believe it should be close. Maybe reworded to remove specific example for you. I'd reword to to say something like "is it worth taking the leap to rails (to gain ... ) or to continue to build on our current (PHP) infrastructure."Sylvie
I tweaked a few main points, including the final question. I hope that clears it up.Hype
Sounds like the reason I quit my last job ;)Sabella
S
6

There are a lot of factors that will influence your decision.

If you switch to rails, keep in mind that it will take a while for you and your team to learn the framework/language and can easily slow adding features for a while. It really just depends on your team, time constraints and many other factors.

Maybe try 1 of the small projects with rails and see if you and your team actually like rails (I dont).

The answer will be different for every team. I would have a group meeting and discuss the pros and cons of both decisions. Then have a vote.

Sylvie answered 1/12, 2010 at 5:4 Comment(1)
I've upvoted this because I agree - but I only wish that my company operated a democratic process for deciding this sort of thing!Hermineherminia
A
9

I think you might get a lot of different answers depending on what type of developers we are.

Personally, I think you should stick to PHP but move to Kohana 3. And then introduce better management and development techniques (documentation, testing, etc). Just my opinion, not really a solution.

Altimeter answered 1/12, 2010 at 3:58 Comment(1)
I (and a handful of others) are excited about KO3, but it doesn't really solve the larger issues (testing, docs, deployment). In fact, it creates its own, smaller, split in the team since our 1 huge KO2 app probably won't migrate for quite some time.Hype
S
6

There are a lot of factors that will influence your decision.

If you switch to rails, keep in mind that it will take a while for you and your team to learn the framework/language and can easily slow adding features for a while. It really just depends on your team, time constraints and many other factors.

Maybe try 1 of the small projects with rails and see if you and your team actually like rails (I dont).

The answer will be different for every team. I would have a group meeting and discuss the pros and cons of both decisions. Then have a vote.

Sylvie answered 1/12, 2010 at 5:4 Comment(1)
I've upvoted this because I agree - but I only wish that my company operated a democratic process for deciding this sort of thing!Hermineherminia
L
5

Moving to Rails (or any other language) will probably cost you a lot in at least one of the following ways:

  1. Time investment. Your entire team will have to learn Rails, while continuing to work with PHP.
  2. Server cost. You'll have to a separate set of servers for Rails and PHP.
  3. Human cost. Some of your team may not want to switch and you will have to hire new people.

My recommendation is that you look into phpUnderControl and start commenting your code. You don't have to write piles of documentation, but make sure that every method is commented.

And finally, my completely biased opinion is that you should give Kohana 3 a try. Even if you can't migrate your existing apps, it could save you some frustration with new apps.

Liberec answered 10/12, 2010 at 9:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.