Monday, July 27, 2009

Renamed Swx to Bombay

Apparently people are using the word Swx to refer to the SWX format (an open-source subset of the SWF format) which has an associated application called SWX PHP that might lead to confusion if I continue calling my project Swx.

Coming up with an alternative name for Swx, for some reason, brought back memories of the time Bombay (the city I live in and a name I loved) was renamed to Mumbai. I was toying around with the idea of calling my project Bombay and liked it a lot, so I went with it.

Friday, July 24, 2009

Routing in Bombay (WIP)

Default routes

Here are some examples that illustrate the default routes I came up with:

Example Request handler function
GET / _home()
GET /foo _show()
GET /foo?baz=qux _query()
PUT /bar _save()
DELETE /bar _delete()
POST / _post()
POST /login _login()
GET /users/ users_home()
GET /users/1 users_show()
GET /users/1?baz=qux users_query()
PUT /users/2 users_save()
DELETE /users/2 users_delete()
POST /users/ users_post()
POST /users/poke users_poke()

I chose *_save because it captures both the CREATE and UPDATE semantics of PUT. The other option was *_write() requiring me to use *_read instead of *_show for symmetry but that didn't feel right.

*_query was chosen over *_search and *_filter because its asking semantics is generic enough to be used in many different situation than the locating and removing semantics of the alternatives.


If none of the above handler functions are found, mapper.lib will fall back on the catchall handler functions.

Request fall-back-1 fall-back-2
* /users/1 users_catchall() _catchall()
* /foo _catchall()

Update July 27, 2009: Renamed Swx to Bombay

Thursday, July 23, 2009

Make your time framework, index.php are belong to me!

I've stopped active development on Inertia primarily because developing web applications in it did not feel very PHPish. It felt as if the web application was subservient to the framework instead of it being the other way round.

Inertia was an experiment in how a Resource-Oriented Programming (ROP) Platform would look like and it was an awesome learning experience, but its time to move on.

Sunday, July 05, 2009

Describing Writting your web application using Bombay (take 2)

Scratch that! Screw describing the web application. Just decide for me and tell me what I need to do.



require '/path/to/bombay.php';
requires ('mojo');

function _home()
echo "Hello World";


Trade-off flexibility for minimal cognitive strain and busy work.

Update July 27, 2009: Renamed Swx to Bombay

The problem with ugly, large and slow code

Bjarne Stroustrup in Masterminds of Programming:
"Ugly" leaves places for bugs to hide, "large" ensures incomplete testing, and "slow" encourages the use of shortcuts and dirty tricks...