Derek Barber

Learnable Programming

I’ve always had an interest in education and learning. This has naturally fit well with my profession as a software developer / programmer. These days most professions require some level of continual improvement and ongoing education, however with programming ongoing “professional development” is our bread and butter.

To some (and I would fit into this category), this is an attractive element of the job as it keeps things challenging and the work rarely gets boring. To others it is a wearying trend, knowing that what you learn this year will most likely be obselete by the next year, or at the very least, will have gone through significant evolutionary development. If that’s you, then you probably want to find another career because it’s not slowing down anything soon.

My interest in the field of education is not limited to my own self improvement, but rather it extends out into a passion of mine, which is to teach others about technology, and specifically programming. As such, I take a keen interest in various websites, courses and tools which have been created to teach programming. Throughout the years of using and interacting with various educational materials, I’ve found that I’ve always been left wanting, but I never felt I could express what exactly was missing. Thanks to Bret Victor’s incredible article Learnable Programming, that has now changed.

Bret’s article begins by asking a question:

How do we get people to understand programming?

He then utilizes the Khan Academy’s programming courses as an example of programming education gone wrong. I found it helpful for Bret to utilize a popular example like the Khan Academy since their approach is a very common one. Thus the critique isn’t specifically aimed at the Khan Academy, but rather upon the popular style of teaching programming that they epitomize. From there the article critiques various aspects of this teaching approach while showing how it could be done better, much better.

In Bret’s words:

  • Programming is a way of thinking, not a rote skill. Learning about “for” loops is not learning to program, any more than learning about pencils is learning to draw.
  • People understand what they can see. If a programmer cannot see what a program is doing, she can’t understand it.

Thus, the goals of a programming system should be:

  • to support and encourage powerful ways of thinking
  • to enable programmers to see and understand the execution of their programs

This is truly a brilliant article, one of the best I’ve ever read on how to teach programming. It should be mandatory reading for any educator in the field.

So please do yourself a favour, stop whatever you are doing and read Learnable Programming today.

Book Review: UML Distilled

UML Distilled Cover

About a year ago I took a class entitled Advanced Object Oriented Software Development, a significant portion of which was spent drawing UML (Unified Modeling Language) diagrams for the software we were designing. I needed to get up to speed with UML in short order and the materials given by our professor were painfully obtuse. To the rescue came this fantastic book UML Distilled, the contents of which are indeed true to the title. It takes a very large and dense subject like UML and distils it down to the essential aspects. If you are a working software developer and want to start utilizing UML in the design of your projects, then this is the book you should get.

Busy Seasons

I had great hopes that I would be writing regularly on this blog and yet I’m looking at it now and realize that I haven’t written anything for 4 months. 4 months. It all feels like a blur to me these days. This is indeed one of the busy seasons of life.

I can’t remember a time of life when I have been more busy than the last year or two. It certainly has been a self-inflicted form of busyness, but it is busyness none the less. This is what you get then you work full time, go to university part time to finish off a degree, have a growing family that you want to spend time with, and yet still have interests, hobbies and somewhat of a life.

5 Years

What does 5 years feel like? That was the question that I found myself pondering this morning.

Today my eldest son Jonathan turned 5 and one of the first things I did after he woke up was to sit him on my lap and tell him the story of when he was born. It’s one of his favourite stories, and he loves to hear how that day transpired. From the time that my wife entered into labour at about 5am up until when we held our precious newborn in our arms around 10pm. It was a long and wonderful day. One of the best days of my life.

Zend Framework Deployment With Capistrano

Personally, Ruby is my favourite programming language and whenever I have a choice in the matter I’ll be using Ruby for any projects. Likewise, when building a web app I’ll turn to Ruby-based frameworks like Rails or Sinatra. However, I know for me I don’t always have a choice in the matter.

Currently one of my largest projects is maintaining and improving a very large and complex PHP / Zend Framework web application. To even think about porting this app to Rails would be off the table and despite such limitation, I want to make the process as comfortable as possible. To do so, I will still attempt to use the tools I’m familiar with whenever I can. Enter Zend Framework deployment with Capistrano.

I’m sure they’re out there, but I’m not aware of any PHP or Zend Framework based deployment tools that even come close to the functionality of Capistrano. The great thing about Capistrano is that you’re not limited to using it with only Ruby and Rails based projects, but it actually works beautifully for any kind of project. In my case, it was an ideal deployment solution for this large PHP web application that I manage.

In this post I will detail exactly what you need to do to get your Zend Framework apps deploying with Capistrano. To play along you will need to have Ruby and Git installed on your system.

Finishing What You Begin

Several years ago now, I started on a journey that I found to be intimidating and humbling. After being out of school for the past 12 or so years, I decided to return and complete something that I had begun those many years ago - my undergrad degree. While I’m not yet done, as the finish line draws ever closer, I am now able to start looking back on this experience and understand how important this journey has been.

There were many times throughout the past year and a half that I really felt that what I was doing was basically insane. Here I was, a 33 (now 34) year old man with a wife, two kids, a great full-time job and over 12 years of experience as a professional software developer. What benefit could an undergrad degree ever serve at this point in my life?

The journey to return back to school began several years ago during a period of dissatisfaction with my career as a software developer. I found myself starting to ask the question: can I really see myself doing this for the rest of my life? Sure it had been a fantastic ride so far, and I really did enjoy writing code, but I had a hard time seeing myself still doing this in my 40s and beyond. It was this time of personal re-evaluation that I began to think about some other options for myself in the future.

Why Test-driven Development?

Perhaps you’ve heard of test-driven development but don’t really know what it is. Or maybe you know about it but you just don’t know why you would ever want to use it. In this article I hope to give an overview of exactly what test-driven development is and why you should consider integrating it into your software development process.

It is important to note that Test-driven development (TDD) is not solely a testing technique, but rather part of a holistic design, development and testing process. The basic idea of TDD is that instead of writing your code first and then writing tests after to ensure the code works, you write your tests first and then write the code that will get all the tests to pass. This is known as a Test-First approach.

There are two generally accepted views on how and why you should practice TDD in your software development. The first view sees TDD as a technique for specifying your requirements and design before writing the actual program code. The second view takes a more pragmatic approach and sees TDD as a technique that helps programmers write better code. Regardless of the view one takes, what TDD practitioners all agree on is that TDD will not only improve your code, but it will also improve the overall design and implementation of your software system.

Debugging Public Key Authentication

This is a follow-up to my recent post on SSH Public Key Authentication. I was setting up a remote account with public key authentication so that it would work with my capistrano deployment process. Basically I wanted to be able to run cap deploy and have it execute without needing to type in the password of the remote account. While setting this up I ran into an issue that I thought would be helpful to document, both the problem and the solution.

I set everything up as expected, copying my public key into the ~/.ssh/authorized_keys file on the remote server. However, it just didn’t work. Whenever I tried to log into the server, instead of immediately logging me on, it still gave me the password prompt. In order to dig a little deeper and find out exactly what was going on, I ran the ssh command in verbose mode (adding -v). This showed me that my public key was offered but then rejected: