Mon, Oct 8, 2012

Node.js, Express, Hello World Formula 1 Style

In my ongoing efforts to be a better developer (plus I just like tinkering) I thought I would take a look at node.js.

I did play with node.js about a year ago where I setup a TCP listener to listen to a TCP Server on the network broadcasting XML messages, I then took these, formatted them to JSON and passed it to a browser using Socket.IO. It was pretty cool but the project never came to anything.

However, I thought I would re-visit and setup a proper development environment on my Mac at home.

Editors

There are many editors/IDE’s that you can use for node.js development such as Vim, Eclipse, WebStorm, Aptana Studio, Emacs and Cloud9 IDE. As I have used Sublime Text 2 (ST2) before I thought I would use this because I like it and all the cool kids use it!!

Coming from a mainly IDE based background I started to find things a bit hard going however ST2 allows plugins to be used to make the user experience a lot nicer. Below are a list of plugins I have installed:

Fri, Sep 28, 2012

Abstracting the File System

Following on from my post about OSS I thought I would illustrate how cool OSS can be.

The day before that post was published I was working on a program that required the file system. All you good developers are going to know that the file system is a dependency and dependencies are bad and this post will probably be a bit like preaching to the choir however I thought it was worth posting.

So you have a a method similar to this:

public void DoSomethingCool()
{
  //do some stuff now write to file

  FileInfo f = new FileInfo("C:\Mytext.txt")
  using(StreamWriter w = f.CreateText())
  {
    w.WriteLine("This blog post is cool");
    w.Close();
  }
}

You are writing to a file to record something and need to test your method. Remember, unit tests are supposed to be fast. Typically anything that writes to a database or a file system will be slow however, we also have the problem that our method is now dependent on the file system and dependencies are bad. Wouldn’t it be handy if we could make FileInfo a representation of an interface.

Tue, Sep 25, 2012

Is OSS good for your career?

Got your attention? Good.

Let me start by pointing out there are many opinions about the answer to this question. You will have yours and I have mine, that’s called freedom of speech. I would like to hear your opinions so leave it in the comments.

Let me explain that I have had 4 jobs in the last 10-11 years. 3 of those were via recruitment agents. They check your skills, tick them off and pass you over to the employer if they match and hopefully you get an interview. That process has happened to me in each of those 3 times.

If you have read my previous blog posts you’ll know I have spent the last year reading a lot of other peoples code and learning all the best practices I can in a bid to become a better software developer as well as give back to the developer community where I can.

After spending a couple of months porting NerdDinner over to NancyFX I realised that I had not looked at ASP.Net MVC 4 and the new features built into it. I felt slightly strange at that point as I was usually an early adopter of these things keen to check out the new stuff. I think this was partly due to the fact I had spent a lot of time learning NancyFX and really quite enjoying the framework and interacting with the small community of people who use Nancy.

Fri, Sep 21, 2012

NancyFX, RavenDB, NerdDinner and Me

As I said in my first post, NancyFX was my first port of call in my OSS adventure. The reason I had come across it was by following @squidge and @cranialstrain on Twitter. At the time they were talking about it quite a bit so I thought I’d take a look. I was also keeping track of lots of people talking about RavenDB.

What is NancyFX?

From the official docs this explains NancyFX:

Nancy is a lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono. The goal of the framework is to stay out of the way as much as possible and provide a super-duper-happy-path to all interactions.

This means that everything in Nancy is setup to have sensible defaults and conventions, instead of making you jump through hoops and go through configuration hell just to get up and running. With Nancy you can go from zero to website in a matter of minutes. Literally.

Mon, Sep 17, 2012

I’ve started blogging. Why?

So here I am, Jonathan Channon, blogger. I never saw the point of blogging before so why now?

I have read and spoken to many people regarding blogging who were all in favour of it. I would always argue that I don’t have time, I have nothing to blog about or I’m not that insane to start blogging about stuff I barely understand just so the masses can come and hurl abuse at my ignorance. However I recently read an article by Ben Dornis titled “How I learned to stop worrying and love my community”. He outlined all the reasons why a lot of people don’t publish their code and don’t publish their thoughts online. I thought he was being modest, the man is clearly talented at what he does so he didn’t have to worry however, someone like me still had these fears.

Menu