Planning the Spontaneous

It's more than just a blueprint.

Snow Go From Here

Posted by Robert Chow on 08/01/2010

If you haven’t heard, Britain’s having one of it’s coldest winters for a long time – cold enough to rival that of 1963 where the snow was at some places 6 metres deep.

I was suppose to go back to Devon to work last Tuesday, and unsurprisingly, due to the weather conditions, this wasn’t the case.

Instead I’ve been stationed here for another week.  Another week spent in Manchester, and some might say lucky you.

I thought so too, but that only lasted so long.  I actually wish I was back in Devon for now.  Ok, it might not be the most exciting of places, but regardless, I do enjoy my time at work.

I’m trying to do some now, but “working from home” is literally “working from home”.  Nothing is as productive as it can be, and nothing goes according to plan.

Sure, I have done some.  But it’s not quite the same.

Anyway.

I’ve had a request to show how to do the multiple Bézier curves I did earlier – that post also seems to be the most popular topics of the blog.  Lucky for some, I am currently trying to write a toolkit for the Renderer library, and being able to create fancy Bézier curves will feature in the near future.

For now, whilst I’m out of office, I’m looking at a few topics me and my supervisor have been meaning to touch upon.

Ninject

A tool used for dependancy injection, a form of Inversion of Control.  The traditional flow of programming is to use a central piece of code to control the flow; Inversion of Control takes away this design principle.  Dependancy injection introduces the notion of both high and low level modules independant of each other, and should only depend on their abstractions.

M.Spec

M.Spec is a testing framework, and as far as I’m aware, it uses a similar principle to BDD (Behaviour Driven Development) – it uses Given/When/Then statements.  I find these statements can be easily read as given initialState, when performing anAction, then newState.

Python

I’ve been meaning to try and get to grips with this new(ish) language for the past couple of months, but never really gave myself enough time.  A dynamic language, it looks to promise an increase in readability and productivity.

Fluent Interface

This is one thing I am most definately interested in.  Using a fluent interface increases the readability of code, trying to make it read like normal English.  To achieve this, an object may invoke a method, and return itself, allowing the client to invoke another straight afterwards.  Creating a fluent interface also takes the advantage of extension methods in C#.  Read this.

20.Minutes().Ago()

To achieve this, create an int extension Minutes(), returning a class representing time of x.minutes (this case 20).  To create the Ago(), add an extension to the time class (or add it as normal if the time class is self-written), and return an object of the same class, but representing the time now minus x.minutes.

Apparently it takes a rather lot of effort, but to achieve better readability, especially something something close to fluent English, is something I’m definately willing to spend time on.

Let’s hope I’m back soon.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: