I hate video tutorials

What the hell is this about!Sponge Bob like video for angularjs

Please stop making video tutorials about coding subjects. Stop it or you'll go blind - no seriously. I cannot stand video tutorials. When I do a search for information on learning a new technique I dread that awful feeling when arriving at the page only to see that big rectangle with the right pointing arrow/triangle. I feel cheated.

Everything I've learnt in my professional life has been through the written word. Yep - I know. What about school/uni/college/professional courses. Sure, these learning institutions all have a classroom or lecture component. Aren't these just like video tutorials? NO THEY'RE NOT. Classroom learning and even lectures are almost always complementary or supplemental to text based learning. They are two way learning environments. The teacher can respond to questions from the class about issues or problems raised by the text.

Now I'm well aware that different people learn in different ways. Some people are more visual learners and others more text based (me). That doesn't mean you can't accommodate the variety of learning styles alongside the more traditional text based style. And in all honesty, despite coding nearly always being a text based endeavour, it does need not only some visual explanation (ie code examples) but some 'hands-on doing'.

After spending some time on the Angular.js codeschool tutorial website I was almost in a state of tears. After sitting through what seemed like an eternity of Sponge Bob like cartoon figures singing about controllers and views, I then had to endure some guy pointing to a picture of TEXT listing the things I needed to know: like HTML and JavaScript. Why didn't they just have that same text before the video? They're not even saving themselves the time taken to type out the text and then publish it! At this stage I bailed.

I always avoid video tutorials for these reasons:

  1. They bore me and I often lose concentration and my mind wanders.
  2. You can't really skip over sections or scan ahead to get to what you are looking for or to even check if this is actually what you want.
  3. I can read faster than a video can talk (even if it is Sponge Bob talking).
  4. I can't refer back to a section in the text if I feel I haven't quite got the point right later on.
  5. I don't have to risk any accent issues (I've been told by Americans that they have to really concentrate to understand my accent!). But also - we have to think of non-native English speakers who may be able to read English quite well but not be as fast listening to the various English accents.
  6. I don't have to worry about the quality of the sound (I find this a problem quite often - probably my sound setup).

So why do coding organisations use video tutorials

  1. Hey - its the youtube/twitter/facebook generation. Videos get better hits when reposted on twitter or facebook.
  2. People love to see their heads on TV.
  3. It's easier than writing. Although most coding videos seem to be someone pointing at something they have written.

None of these are actually anything to do with what is supposed to be the purpose of a "tutorial".

Docpad and Jade

jade buddha

As you may realise, this site is entirely written in Node.js using the Docpad framework. I've also started using the Jade templating plugin. Docpad is able to run a number of templating systems such as Eco or Markdown - as well as straight html. And they can all be running simultaneously within the one application (although I would imagine it might be quite tricky for a developer to be constantly switching templating systems).

A lot of node applications, however, seem to use the Jade templating system. I'd mostly been using CoffeeScript and Eco up until now. So I thought it was time to get into Jade. It was a bit of a learning curve. Below is the Jade code that generates the home page. You'll notice that it actually calls a Docpad "partial" written in CoffeeScript, which was actually legacy code written for a previous version of the site. The plan was to update that code to Jade - but it does demonstrate the interoperability of Docpad.

				h4 Node.js and Web Development
				h1 Steve McArthur
		.row.centered-text(style='margin-top: 4em; margin-bottom: 3em;')
					| Hi, Im Steve, a Web Developer specializing in Javascript and Node.js development.
				| Originally from Perth, Western Australia, now living in the UK.
			- posts = getCollection('posts').toJSON()
			!= partial('post-snippet.html.coffee',{posts:posts,number_posts:3,trimTo:500})


node.js logo

Have been playing around with Node.js a lot lately. I like what I see. The essential feature of Node is writing JavaScript on the server side and not just on the client. There’s a lot of sense to that. But there’s also a bit more to it. Making use of the whole asynchronous approach that JavaScript lends itself so well to, is also a feature that I’m liking here.

All the beginner tutorials seem to demonstrate something around the creation of a simple web server. And in my playing arounds I am no different.

//load the http object
var http = require("http");
//load the file system object
var fs = require("fs");

http.createServer(function(request, response) {

	if (request.url.indexOf('index.html') > 0) {
		fs.readFile("index.html", 'utf-8', function (error, data) {
			console.log('reading file');
			response.writeHead(200, {
				'Content-Type' : 'text/html'
			//write out the contents of the html file
			//to the response stream
		console.log("not index.html");


console.log("Server has started.");

Some kind of disk I/O error occurred - SQLite

I got the extremely helpful "Some kind of disk I/O error occurred" message using the System.Data.SQLite .net assembly today. This was a big SQLite show stopper. So I thought it was about time I figured out what was causing this. The error was occurring when I tried to post an update to the SQLite database in the local App_Data folder of an asp.net application. As soon as the application attempted to post the update I got the dreaded "Some kind of.." error and a SQLite journal file was created in the database folder. After this, the database became unavailable. It became available again once the journal file was deleted, but I was then back in the same situation once another update was attempted. The curious thing was that this behaviour didn't occur in the development environment, only when uploaded to the live server. My first thought was that the application for some reason didn't have rights to write to the App_Data folder. But the journal file was writing to the location with no troubles. Finally I hit upon a forum post on the System.Data.SQLite forum. This pointed in the direction of using the statement to set the journal_mode value to something other than "DELETE". The PRAGMA statement is executed exactly like a query, so all that needs to be done is to execute the statement using a SQLiteCommand object in the same way you would execute any other SQL statement.

using(SQLiteConnection conn = new SQLiteConnection(sqliteConnectionString)) {
	SQLiteCommand cmd = new SQLiteCommand();
	cmd.Connection = conn;
	string pragma = "PRAGMA journal_mode = OFF";
	cmd.CommandText = pragma;