A computer could function well for up to 3 years, after which maintenance or upgrading work need to put in place to keep it running up to 5 years; and the same cycle applies to software development.
If it ain’t broken, why fix it?The current stack had served we well for the past 6 years, and I could probably extend it for a few more years due to the still active framework community and fairly well maintained codebase (after all, I am the only programmer). The benefit of an old stack is that I get high productivity, it’s fairly easy and fast to implement new features and modules because the foundation and supporting library is already there, and I am used to the ins and outs of the system (no more time consuming debugging of a new component). The downside is that I might had made some lousy decisions on how some things should work, and still pay the price to maintain it because it’s too costly to change. The thing is, I don’t know anything bad about the current system, because I haven’t use a better system. I do enjoy the high productivity, but there are always some temptations.
I wanted to develop a new app, and was planning to use the existing stack because it shall be fast and easy. Then again, I admit I am a bit tired of the old stack. I was fascinated by Google App Engine, Python or Ruby, and heard so much about CoffeeScript and Backbone. I might not find the will to upgrade the existing app to a new stack; but if it’s to develop something new, I should probably learn something new as well. Without much logical reasoning, I decided to seek out a new stack.
Reasons for Reboot?
- Platform: DIY platform vs. managed platform like Google App Engine
- NoSql vs. RDBMS
- Temptation of new language: is python and ruby a step forward from PHP?
- Micro Framework: it less magic and automation a better choice?
- Build system for front-end scripts and resources
- UI and Responsive web design
- From a publication-centric to user contribution-centric
- Unloading of old baggage
Google App EngineI decide to use Google App Engine. I understand the proprietary and lockdown nature of things (with potential of regret if Google screw up), but I do like the idea of being liberated from system admin stuff (webserver and database installation and configuration, security, scalability, etc.). Besides, it had some nice services like Images (Picasa-grade image serving), Memcache and Task Queues. The downside is dependency on BigTable, and with no possibility of exploring MongoDB; though MySql is possible on GAE, but the setup felt like second class citizen. Another downside is I can’t install almost can't install anything on GAE (except pure Python code without disk I/O). There are definitely some advantages and drawbacks, but I choose to let Google handle the platform sociability part.
The road map and bug fixed might be a bit unpredictable, with certain issues remain unresolved for years (fallen into the black hole) and certain feature taking 4 years to arrive. I am hoping things a more matured after 4 years.
NoSql: BigTableWhy use NoSql? It’s because that’s the preferred storage on GAE, and I don’t mind exploring the NoSql way. The big advantage is that you got a really big database where you need it to scale, and schema changing for traditional RDBMS lock up the table big time. I don’t think I would hit such massive scale. I believe there are a lot going on for MongoDB, but sadly it’s not an option opened to me at the moment.
I do like a few cool tricks with BigTable (or NoSql), especially the newer NDB API. It has a few interesting property attributes, such as repeated where you could make a field into list without additional table. With ProtoRPC, you can have enum fields. You can have structured property, it’s like putting another table structure as a column, thus reducing the needs for multiple tables, and inheritance is supported. JSON, GeoPt and Pickle (Python object) are native fields.
The query might be limited (no like statement, no join).
PythonI am bothered by the favoritism gained by Ruby and Python language, and decide to check it out. Language is like a culture (it's about the people and community, with a specific style). PHP doesn’t really have a feature advantage over Java or .NET, I just don’t like strong-typed stuff and enjoy the flexibility of PHP array. Since I am on GAE, python is the way to go for me.
Python style is consistent using underscore convention, with strict indentation and directory structure representing namespace, and elimination of semi-colons and curly braces (which is fine by me). PHP does have a messy naming convention with its core library. I haven’t dig far, with it does have some nice libraries such as WTForm.
Micro FrameworkDjango is the de facto full stack framework for Python (like Rails for Ruby), but I wanted to try a micro framework instead (less magic and automation). Plenty to choose from such as CherryPy, web.py, Pyramid and Tornado, and I was deciding between Bottle and Flask. I settle for Flask because it seems simpler with less magic, slightly stronger community support and embraces Werkzeug and Jinja2 (good praise from community, existed for a long time). Bottle one file approach didn’t seem like a seller to me.
I really like CakePHP and think it’s awesome, until I tried something more awesome: Flask. It’s lightweight; with less pre-defined structure and more transparency (the code is cleaner, with more control without hacking the framework). It feels more liberated coding with Flask, the blueprints give it a good structure, and flask-appengine-template serve as a good starting point.
CoffeeScript is love which couldn’t be explained through logicality: it just feels good to code it, with cleaner code, with arguably increased productivity.
Build system for front-end scripts and resourcesFront-end web development had gotten more complex that same kind of build or optimization system is required. I started with Brunch with provided skeleton templates which bring me up to speed with the setup, with an application assembler to auto compile CoffeeScript, to merge scripts and stylesheets, with AMD support.
Yeoman seems like a promising star with extra features such as image optimization, might be worth checking out soon.
UI and Responsive web designIt is convenient to utilize Twitter Bootstrap as the UI foundation (grid system, button, forms, etc.). I am still doubtful about the practicality and development cost of responsive web design.
From a publication-centric to user contribution-centricIn my current app (a restaurant review website), I am more focus on publication: the searching and display of information, where the user contribution features isn’t as intuitive as I would like it to be. Think of Pinterest, where contribution could be easily made through bookmarklet.
Unloading of old baggageSometimes things are done in a less ideal manner due to inexperience or out of convenience, where we are continuously paying the price through productivity lost, less elegance solution or potential security risk. Correction work seems like too much work for too little value, or it is almost impossible to undo previous mistakes, or the framework is the limiting factor.
To start a new, you get to be plan once more, hopefully with more wisdom and less mistakes.
ConclusionAs a programmer, we always have the tendency to reboot once things started to get messy, or being tempted by new technologies. I admit it’s a bit of both, and I acknowledge the price of productivity lost that I would need to pay, and I do believe the ROI with better design, productivity, performance, features and maintainability is worth the price.
I almost decided to stick with the old stack, but I believe the timing and benefits are at the sweet spot.