Time to plug my new blog

Hey there, looks like I haven't posted on this blog in over a year. Blah blah life busy work blah blah.

In the meantime, I've been getting into user interface design. I've created a new blog with the intention of getting more involved in the UI and UX design scenes, for my own learning and sharing information with others. If you're interested in making usable, friendly, happy user interfaces - check out seUXy:

http://seuxy.com/

Split-windows increased my productivity

Once you've used split coding windows, you'll never go back to plain old tabs for your code files (or god forbid.. different windows!). You're probably thinking "Who doesn't use split windows when coding?!!", well I didn't. I knew they were there, but I didn't see the importance or usefulness of them.

I'm not talking about splitting a single file into two parts so you can work on different parts of the same file - I mean diving up your monitor into all the different files you're working on. Seems obvious, right? Since I predominantly work with MVC frameworks, I usually divide my screen into four parts: Model, View, Controller and Javascript or CSS.

Split_windows

If you're working with vim, these are the only two commands you need to know:

:split (horizontal split)
:vsplit (vertical split)

Most GUI editors have a little handle you can drag to split a window into two. If you're using Netbeans, drag a tab around to choose where you want to split the editor.

Since using split windows, I've found I can stay on track better because I can see the entire overview of whatever module of code I'm working on. As a result I am now almost completely immune to coder's block!

So if you're still tabbing around and haven't tried splitting windows, give it a go and watch your productivity soar.

RedBean PHP and Wordpress - A match made in plugin development... heaven?

Wordpress is probably my least favourite place to be coding. I know many die hard PHP fans will argue with me here, but writing procedural PHP code is not my thing. I’d much rather be working in a nice OOP environment such as that of Kohana 3.

Nonetheless, Wordpress is the defacto standard in CMS these days, and there is no denying that it has the widest variety of plugins and themes available. So while Wordpress isn’t too efficient to code with, I thought I would work out how to make developing a plugin with Wordpress a little less painful and more efficient.

Since the plugin I’m working on does quite a bit of data access/manipulation (WP options are not an option!), I quickly discovered the limitations of $wpdb, and started searching for an ORM. Of course I thought integrating an entire ORM system into the procedural Wordpress would not be easy. Then I discovered RedBean.

require('rb.php');
R::setup("mysql:host=".DB_HOST.";dbname=".DB_NAME,
          DB_USER, DB_PASSWORD);

Done.

If you want to include the Wordpress table prefix, put this at the top of your module (or another file if you prefer)

class WPBeanFormatter implements RedBean_IBeanFormatter{
    public function formatBeanTable($table) {
        global $table_prefix;
        return $table_prefix."$table";
    }
    public function formatBeanID( $table ) {
        return "id";
    }
}
R::$writer->setBeanFormatter(new WPBeanFormatter());

From there you can do all your data access through the static R class. The greatest thing about RedBean is that you can write your code before you have even created database tables – RedBean will detect the data you are saving and create/adjust the tables and columns to fit your data. Once development is finished, you can ‘freeze’ RedBean preventing it from modifying the database structure. Here is some sample code to save an object:

$product = R::dispense("product");
$product->name = "Super Gadget";
$product->price = 299;
$product->description = "A dicer, slicer, fax machine".
                           "and coffee maker all-in-one!";
$id = R::store($product);

Get RedBean PHP here.

How to choose a CMS in 4 steps

For many, choosing a Content Management System (CMS) is a no-brainer - work with what you are familiar with and prefer. However, choosing the right CMS for the right job is very important. There are a few things you need to consider when choosing your content management system.

 

1. Who will be using it?

The advantage of a CMS is that it does not require knowledge of coding to change the content displayed. However some CMS interfaces almost need a degree in computer science to understand them.

Make sure that the person for whom you are setting up the CMS can use it easily and isn't put off by the interface.

2. How popular is it?

The popularity of a CMS is important simply because a client may want the peace of mind that they can take the project to anybody else to work on it. I recently spoke with a client who had a Dot Net Nuke website and wanted a developer to add some features, only to discover that no developer wanted to touch Dot Net Nuke. She would settle only for Wordpress, probably the most popular CMS available today - due to its popularity amongst developers.

Don't choose a CMS just because you think its nice to develop with. Choose something that other developers can pick up and work with without too much trouble.

3. Is it extendable?

As a developer, I don't want to waste my time messing around bending the CMS to my will. Instead it should provide interfaces and hooks to allow full customisation of everything. If no custom functionality is required however, its still nice to know that the CMS is extendable if the client decides they want  "feature x" in the future.

Don't lock yourself in to the featureset of the CMS, make sure it is relatively easy to develop with.

4. Does it do too much?

Joomla is a very popular CMS as it provides every function imaginable. In other words, it's bloated. Every Joomla website I have used has been cluttered, confusing and generally just a pain to use. The administration interface is also confusing and not nice to work with.

Don't choose the CMS with the most features! Remember the words of poet Robert Browning and designer Ludwig Mies van der Rohe:

Less is more.

 

What do I use?

For most websites a custom installation of Wordpress is great. Developing extensions for Wordpress is not so much fun due to its fairly messy codebase, but the huge library of extensions available and the widespread usage of Wordpress makes it a great option.

For websites which require fairly custom functionality I have been very happy with the recent developments of PyroCMS. The main advantage of this CMS as a developer is that it is based on the Codeigniter PHP framework, which many developers are familiar with. In addition PyroCMS provides fairly basic CMS functionality on top of which I can build upon any custom functionality without cluttering the interface with functions irrelevant to the client.

There is no one CMS that solves every problem, so take the time to choose the right CMS for the right job.

What's in a good company name?

Although I've done some odd web design/development under my own name for a while, now that I'm on a break from uni I'm looking at getting more serious about it. I'd like to be able to expand beyond just working on my own, and enlist other people to help me out when I'm short on time or lack skills in certain areas. To create room to grow, naturally the next step is to start working under a business name.

But what goes into a good name?
It seems there are tens of thousands if not millions of design agencies out there. Every time I think of a great name, I type it into google only to discover a design firm has already taken it. Image association is important in a name - especially if the image can be emotional. My favourites are those that inspire images of freshness, crispness, meadows, hills and bright sunny days - and this is what I would like my business name to reflect.

Think of the logo
Every time I come up with a name, I try to think of a basic idea of a logo to go with it. Think McDonalds - I bet you immediately imagine the golden arches. Think BP (British Petroleum) and you probably now have that image of a big green flower in your mind (sneaky psychological move to appear green on their part). These image associations help the companies stick in your mind and create brand awareness and familiarity.

Make it meaningful
The name should immediately give an idea of what the business does. Most firms seems to go with abstract names then add the word 'designs'. I think this is great - one word to inspire imagination and one word to explain what they do. Abstract names are also very Web 2.0 :)

Make it memorable
If the name is too abstract, people will be struggling to remember the name while they are sitting in front of a blank search box. If its too generic, it will be hard to distinguish yourself from others and appear somewhat original.

What qualifications do I have on this topic? None at all, apart from watching TED talks and reading blogs. I'm just writing this for something else to do because I can't think of a good name :D

Stress and Productivity [Leaving Japan, Reflections. Part 1]

8 days left.

This year has been very different than I expected. I didn't achieve as much as I planned in some aspects, but beat my expectations in others. More importantly I changed as a person. I realised some fundamental things about myself, life and working.

The first thing I realised is that doing nothing is not as awesome as it sounds. Workwise, this year was not very challenging which left me with a lot of free time. But even with an exotic country to explore (and oh I explored!), there was something missing - some purpose. I reassured myself in knowing I was here to improve my Japanese. But I haven't had much opportunity to make progress in my life with real, useful things.

I think doing nothing also decreases motivation to do fun things- and makes you enjoy things less. The old adage 'work hard, play hard' definitely applies here, and I think is an integral part of Japanese society. If you are satisfied with work you've done, you can relax and not feel guilty when playing while at the same time feeling satisfied that you have made progress.

The people getting most out of life are not always slacking and messing around, but they are making some kind of progress. To some people this is beating their own records (athletes), to some people it is making a difference in the world. It seems everybody who is happy with life has one thing in common - they enjoy their 'work'.