ABOUT US PRODUCTS GET INVOLVED BLOG

Ushahidi Mailing Lists

« All Listsdevelopers@list.ushahidi.com

Message: previous - next
Month: March 2010

Clean Up Time!

From: David Kobia <david@...>
Date: Mon, 15 Mar 2010 10:51:21 -0400
Hi Guys,
First I wanted to thank all of you for the hard work that's been put
in so far. It's been a busy last few months and Ushahidi's codebase
has grown significantly. The rate at which new features have been
added to the system also means that bugs are rampant, many weeds have
sprouted in the system that need to be pruned - and generally the
system needs a little sprucing up. So I wanted to suggest the
following:

* A feature freeze on our current release cycle (1.2 -
http://dev.ushahidi.com/versions/show/7), and quite possibly bumping
the 1.2 and 1.5 releases with an aim to release a 2.0 that is
'stable'.
* A code-a-thon focused on completing the currently listed features,
and cleaning up the codebase.

Cleaning house would encompass the following:

1. Code Cleanup
~~~~~~~~~~~~~~~~~~
Our Controllers are horribly bloated. In a rush to get some of the
stuff done, many MVC principles have been overlooked (or ignored!).
Business logic should be in the models, and Application logic should
be in the controllers. A controller with a few hundred lines of code
is simply inexcusable, and we're all to blame in one way or another.
To understand this better, you can go to:
http://www.developer.com/design/article.php/3856246/Fat-Models-and-Skinny-Controllers-Bring-Out-the-Best-in-Your-MVC-Framework.htm

There's also a lot of repetition, so I want to encourage code re-use
via helpers/library classes

Since we're using the Kohana framework - it was agreed from the very
beginning to stick to the Kohana coding standards, which you can view
at: http://dev.kohanaphp.com/wiki/kohana2/CodingStyle - Clearly we
have plenty of work to do here. Moving forward it is absolutely
necessary that we stick to these standards.


2. API
~~~~~~~~~~~~~~~~~~
Our API needs to be absolutely bullet proof in order to encourage 3rd
Party applications that interact with Ushahidi. So far it works very
well, but a few functions could be optimized.


3. UI Cleanup
~~~~~~~~~~~~~~~~~~
Cleaning up our User Interface involves the following:
* Making sure our HTML is XHTML Compliant
* Working on the admin user interface that now has a myriad of options
and settings, and starting to become a little confusing for the end
users
* Less PHP in the Views


4. Database Schema Cleanup
~~~~~~~~~~~~~~~~~~
There are quite a few stale schema records that need to be removed.
Add to that the sql schema itself is poorly documented. One of the
best sql schema conventions I've come across is at Sahana
(http://www.sahana.lk/wiki/doku.php/dev:sqlpolicies).


5. Documentation
~~~~~~~~~~~~~~~~~~
In case it wasn't stated before we're using phpDocumenter (phpDoc), so
any DocBlocks should follow their convention. Much has been done
already with the current code, but more can be done.  Self-documenting
code will be so much cleaner and comprehensible if we can add phpDoc
DocBlocks to every file, class, function, and where needed - constant
or variable. More information at:
http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.pkg.html

Please feel free to add your thoughts to this discussion too!

Lastly, please don't forget the Tuesday Skype Chats at 1pm GMT. Link:
http://skype.ushahidi.com - we can discuss these items in detail, and
a strategy for getting them done.