Development and Chekhov’s Gun

“Remove everything that has no relevance to the story. If you say in the first chapter that there is a rifle hanging on the wall, in the second or third chapter it absolutely must go off. If it’s not going to be fired, it shouldn’t be hanging there.”

  • Anton Chekhov 

Chekhov’s gun is a fascinating literary principle that we should be applying to software and app development. In literary terms, Chekhov’s gun means that you should only introduce elements into the story if they are relevant in the story. Similarly, when we develop systems, we need to consider where it adds to the user experience, which is part of a user-centred design.

As any great storyteller can relate, it isn’t enough to give the facts. The reader is on a journey with you and how you lead them determines how they feel about this journey. The same principle applies to system development. How we conduct our user through our systems determines the way they relate to our systems. This journey is something that Apple has managed to master, from the iPod to the iPhone, and users enjoy the experience because it is simple for them. 

Does this mean that all we have to do is create simple interfaces for our users to be happy? Not exactly. The User Experience journey applies to all aspects of our system, including a user’s first exposure to our company and services; and the ability to provide feedback. It is of no use to say to customers your opinions matter and never do anything about their views.

Do you understand what your average user is trying to achieve in a particular session? If you don’t have a clear understanding of this, it becomes harder to remove the elements that have no relevance. This need for insight is why User Research should be an essential part of any development process since it helps give you more knowledge of the user’s behaviour. This knowledge will only get you so far, and it is up to you to use it to improve the user interactions with your system. 

Passing variables from C# MVC Controller to AngularJS using Razor

I wanted to pass some data from my MVC but didn’t want to go the hassle of creating a separate WebAPI call and Angular service, so I used the Angular module’s value method. Then I could inject those variables individually into any controller or services that I wanted to.

HomeController.cs

1
2
3
4
5
6
7
8
public ActionResult Index()
{
  return View(new MyModel {
    Id = Guid.NewGuid(),
    Name = "My Name",
    Value = 42
  });
}

Index.cshtml

1
2
3
4
5
6
7
8
9
10
11
@section scripts {
 <script src="~/Scripts/angular.js"></script>
 <script src="~/App/app.js"></script>
 <script>
 angular.module('myApp').value({
 id: '@Model.Id',
 name: '@Model.Name',
 value: @Model.Value,
 });
 </script>
}

App.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(function () {
    angular.module('myApp', []);
 
    angular.module('myApp').controller('myController', myController);
    myController.$inject = ['id', 'name', 'value'];
 
    function myController(id, name, value) {
 
        var vm = this;
 
        vm.id = id;
        vm.name = name;
        vm.value = value;;
    }
})();

It is also possible to inject the data as one object by doing the following:
Index.cshtml

1
2
3
4
5
6
7
8
9
10
11
@section scripts {
  <script src="~/Scripts/angular.js"></script>
  <script src="~/App/app.js"></script>
  <script>
  angular.module('myApp').value('mydata', {
    id: '@Model.Id',
    name: '@Model.Name',
    value: @Model.Value,
   });
 </script>
}

App.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(function () {
    angular.module('myApp', []);
 
    angular.module('myApp').controller('myController', myController);
    myController.$inject = ['mydata'];
 
    function myController(mydata) {
 
        var vm = this;
 
        vm.id = mydata.id;
        vm.name = mydata.name;
        vm.value = mydata.value;;
    }
})();

Amoq – Liberating Funiture

The redesign of Amoq’s website is finally finished and live, check it out here: Amoq.co.za
The site is built using Drupal 6 and makes extensive use of JQuery and JavaScript to create a more interactive experience. In the next couple of weeks or so their online shop will be live, so you can get their cool products directly from them.

Olivia Morgado Photography

Although this is not a new website, I finally got around to adding this site to my portfolio, which I should have done a while ago. I did this website for a very talented photographer and cinematographer Oliva Morgado and you can check out her website here. We took the design provided by Makers of Stuff and created a Drupal template for Olivia, then built the website so that Olivia could maintain her own images and categories.

 

Welcome to our new site.

Hi,

Finally I got around to doing something more with my site, until now it has been very much the case of the cobbler’s children having no shoes! I am starting to rectify that and what you see here is the start of that process. Of course, as always, other things especially paying things will take priority but