Switch to another language in the middle of a project?
Hi,
My friends and I have been developing a website in PHP on weekends for almost a year now. From what I have read, PHP is not as good as Python or Ruby. I am wondering if we should switch to one of the two. If so, what's the best way to switch?
If not, I am also thinking about implementing a PHP framework. We have been developing without a framework. Do you think we should? Doesn't the implementation mean rewriting the code?
24 comments
[ 3.0 ms ] story [ 55.8 ms ] threadLearning enough to make an informed decision (heresay doesn't count) should only take a few weekends.
After that you can decide for yourselves if it would be worthwhile.
That's how it goes for my slowly-evolving will-release-it-someday-when-it's-ready CL web framework anyway.
I would guess it mostly depends on how much code you have written now (if most of your time has been design/planning, then it might be worth it), and whether or not the people you work with have experience with python/ruby.
Whichever way you go, learning python (or ruby, I suppose) will serve you well in the future.
Thank you for your advice.
I also recommend you check out NOLOH (shameless self plug), there will be a limited developer release at the end of this month.
If you are having performance problems or you code has become spaghetti and your team is most comfortable with the current language then you could start again in the same language. This has the advantage that you could use good sections of the current implementation with the least effort.
I'd love to hear from anyone who's tried this approach.
Even when I work with Django (being a huge Python man myself), I miss having some of the better aspects of Code Igniter (and definitely CI's user guide is stellar).
Don't switch languages mid-way unless you have a great reason. PHP blog-flak isn't a good enough reason (IMHO) unless your team is fluent in another language they can code more securely.
If you are going to change your language every time some new language gets hyped you'll never finish.
Your experiencing a fairly common mid-project crisis. It's almost exactly like a mid-life crisis. You're at the point that you can see the end coming and are wondering if you haven't totally fucked yourself up to this point. You see all the things you could have done better or differently. The key at that point is to try to refocus on the finish line and get yourselves there. Take notes on your mistakes, but always move forward.
Plus you've already sunk a year into it, why set yourself back?
Remember a shitty solution to a problem is better than no solution at all.
The key to your decision here should be how much time and effort it would require to duplicate a feature you want to use in your existing system as compared to what comes out of the box with either a new language or an existing PHP framework. If it's a pain to do and the functionality is critical to your project's success, then you should port. Otherwise, I'd recommend you keep doing what you're doing.
And there are many PHP frameworks, don't implement a new one.
Re-writing something you have now in another language/framework can be (in addition to fun) a great way to learn the new language/framework. If this is just a fun project, well, cool - best of luck to you. If this is a business, something that you'd like to start making money (or at least getting press) from, then maybe the delay will hurt you more than the fun will help you.
In my case, the website was the online component of a small university department. I inherited a PHP codebase that worked, but that I really didn't like, and opted to re-write it in Python/Django. I'm really happy with the decision: I think it was a great way to learn the framework, and the result is a lot better than the PHP site that it replaced, but I don't think I would have done it if I hadn't had a working PHP site to placate students while I was working on it.
Good luck with whatever route you choose to go.
you will find that the more languages you know the easier it is to switch.
i also think you should keep in mind on how you plan to progress in your company, the further you are from writing the code, the more you will want to be able to recognize a broad set of patterns.
If you feel like you need a framework, slowly build it up one piece at a time as you need it. Don't re-write your whole app before you're making money. You can spend a lot of time doing that, and there are so many other things that can potentially go wrong, you don't need to add "it took us too long to get it working" to the list.
In summary:
- I know PHP, don't know Rails
- I could be a victim of the "grass is greener" effect
- I'm already too far into the project to make such a drastic change
- I made the decision to use PHP in the first place - I'd look like an idiot for making such a big mistake (even to just myself and my business partner) And so on.
All very good reasons, and I still think my decision was highly defensible, and I stand by it.
However, it was a mistake - the deadly kind. There's no telling what could have happened if I'd switched to Rails at the time (I had a strong hunch that Rails was way better). But here's what happened:
- Turns out we weren't so far into the project after all (a typical mistake) - it was another 8 months before we released
- I've since learned Rails, and reckon I could probably have redone the whole site in less time than that with Rails (probably 3-5 months with better functionality as a result)
- PHP and the framework I used (custom) were not adequate for our long-term aims. The viscosity ( http://www.inter-sections.net/2007/12/01/comparing-pieces-of... ) of the whole thing increased to the point where after we finally went live, making further changes was too expensive/difficult/error-prone to be worth our while
Basically, this decision killed this product that I spent about a year working on.
I still stand by it, but I've learned from my mistake. I even wrote an article about it (though I didn't mention this specific product, the argument applies): http://www.inter-sections.net/2008/01/22/fundamental-mistake...
What would I have done differently? How about take a 2 week break and give Rails a really good try to see how well I liked it and if it was just an impression. I would then probably have made the decision to switch, and I believe it would have been the right one. I suggest you do the same with your product. Building a product that's painful to evolve is a deadlier mistake than wasting a bit of work. Also, it's not all wasted - you've still learnt about the business domain.
Anyway, good luck!
Daniel
"PHP Sucks, But It Doesn't Matter" (http://www.codinghorror.com/blog/archives/001119.html)
Why introduce regressions and headache by switching to another language that I'm guessing you don't know as well as PHP.
Jeff says it best in that article: "building a compelling application is far more important than choice of language."
Personally, I'd just keep plugging away in PHP. It isn't my favorite language, but it has yet to fail me. It is like the farmers rusty pickup truck. Not very flashy, but it gets the job done.