PHP or Rails?

I’m planning to write a PC configuration manager for an online shopping system, but I can’t decide between adding my own module to a PHP-based shopping system and writing a standalone app in Rails.

It’s the horror. Let’s see:

If I write a module in PHP…

  • I have to deal with a frankly idiotic plug-in architecture and the mess of spaghetti code that is (insert well-known Free Software e-commerce system here).
  • I get multilingual product descriptions for free, but don’t know how they’re implemented in plug-ins yet.
  • I have to write PHP. Yes, this isn’t that bad anymore, but ever since I had to learn Java I’m really fed up with languages that have a C-style syntax, which PHP has.
  • I may have to write some utility functions myself that I take for granted in Rails (linking around between controllers etc.)
  • The thing would run on any installation of (popular Free Software e-commerce system), it would be easy to deploy even on cheapo hosting plans that don’t have Rails.

If I write my own in Rails…

  • No C style. Less braces. Funky Ruby constructs. Collections. ActiveRecord. Rails helper functions. Nice file layout. Yum!
  • I accomplish more per line of code.
  • I have a reason to dig deeper into current Rails, since my Rails knowledge is about four years old now.
  • I would ignore the body of work already done in (insert ugly PHP-based e-commerce solution here).
  • Deployment would require a Rails hosting plan.
  • I would eventually have to extend this to be a full e-commerce system, but for my limited feature set, it wouldn’t be that big of a deal to do this.

If I list these points, it seems that I really, really want to do things in Rails, but somehow in my heart I’m not quite sure. I’m split 50/50 between both solutions, no matter how rationally I try to look at them.

Bah. Dilemmas.

Edit: I just discovered Spree, a framework for e-commerce on top of Rails. This seems great, especially since it’s a gem, not something that uses Rails Engines. Maybe I can kickstart development using that.

Edit 2: I talked to the Spree guys, read a lot of their documentation and had a look at the code. This is a really cool project with lots of potential! For now I just contributed a locale for Switzerland (in German), but I’m seriously looking at migrating my store to Spree and perhaps help with the features that are necessary for a PC configuration system inside it.

Woohoo 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s