No book has had as much impact on my programming as Object Thinking (by David West) (aff.). I still like to refer to it and I often read the notes I have made from it, I almost think of it as a Philosophy book, that’s how much it has affected me.
Over the coming weeks, I will explore why I am convinced that “thinking like an object” will help your programming, with both practical and more philosophical posts. For this first post, I will write a quick introduction to the subject.
Before, my programming used to go like this: I’d get an idea for an app, I’d open Eclipse, I’d set up a new project, I’d hurriedly create my first activity (I mostly program for Google Android so apps revolve around “activities”), I’d fumble my way until I thought it did what I had imagined. The problem is I lost a lot of time and a few of my projects never got anywhere because I got stuck.
While I can’t summarise David’s book here, I can share a few lessons I have learnt from it:
- User stories are very important. You have to put yourself in the shoes of your users and imagine what they will actually do with your app.
- Don’t think about the GUI when you initially think about what your users will do with the app. In the first stages, your user stories should be like “user will select the calendar view he/she wants to view”, and not “the user will click on the button to select the calendar view” because you have to remain open to all the ways a user may do a selection.
- Brainstorming isn’t just for writing, it is for programming too. Take pen and paper, away from Eclipse (insert favourite IDE here), away from your computer, away from your computer books. Only pen and paper, and jot down words and verbs for how you imagine your app will work. Key actions like “select”, “confirm”, “delete” and key descriptions like “application form”, “calendar”, “address list” etc.
- Coding is the easiest part. Once you know what to code – that is, once you know what you want your objects to do - the process is actually quite simple and you can easily get help when you are stuck, because you know what to Google for (or what to ask for on a forum).
- Objects are entities with responsibilities. When you go to a shop, many people interact, or have interacted, to make sure you go home satisfied. The store manager has ordered the items, the warehouse worker has put them on the shelves, the checkout worker is picking up your items one by one and scanning them, the other customers form an orderly queue so you know when you will be served etc. Objects are the same – they work together to deliver a service, and as the programmer, you have to find out what sort of objects you need and what you want each of them to do. You don’t need to yell at them to tell them what to do, you simply make sure that they know what to do, have enough information to carry out their duties, have a way to inform other objects if those objects ask them to, and take care of the items they are given custody of (eg variables).
Next week, I will post scans of my notes for an app I am currently working on, in an attempt to highlight how I try to train my brain to think like an object. Object thinking isn’t about a specific tool or method, but certain tools will provide the necessary scaffolding for your brain to have a solid base from which it can decompose the problem domain into objects that work well together.

No Comments »