Walter Higgins

Tinkering with Software & the Web

Cork City Marathon 2017

2017/05/07 17:03

Four weeks from today I'll be running the Cork City Marathon. It will be only my 2nd Marathon. This one is a grudge match. I ran the same race last year and finished in 4 hours 52 minutes. Not a great finish time. I've been training for this upcoming one since late February and (knock on wood) the training has been going exactly to plan so far.

This morning I finished my 2nd long run (17.4 miles) from home in Ballincollig west of Cork City to BlackRock Village east of Cork city and back. I had a great race two weeks ago - the Great Railway run from Cork to Carrigaline - a 25 Kilometer distance. I averaged 8:46 per mile in that race - almost fast enough to revive hopes of a sub-4 hour marathon. I'd need to average 9:09 per mile to do a sub-4 marathon. I don't know if the legs, lungs, heart and training are up to that just yet.

I have just one more long run - 20 miles next Sunday, then the Taper begins. In the lead up to a Marathon it becomes all-consuming. I fluctuate between thinking I can realistically do a sub-4. At the very least I hope to do a sub 4:30 . If I take longer than that I'll be disappointed. There's a lot that can go wrong in a Marathon. Last year I injured myself in Training - I ramped up the miles too quickly and too early. This year I've been sticking to a more conservative plan which only increases mileage at a rate of < 10% per week. Last year, the day of the Marathon was quite warm. I held back for the first 5 miles sticking to a 11 min pace. To be honest I was so nervous about the injury and making it worse that I was just happy to get around the full 26.2 miles. This year I have 3 time bands in mind.

If I complete it in under 4 hours 30 minutes I'll be happy. If I do it in under 4 hours 15 minutes I'll be happier. If I do a sub 4 I'll be over the moon.

Just four weeks to go so we'll see. If you're on strava you can see my training log.


The Witcher Books

2017/04/17 15:15

The Witcher videogame for PS4 was on sale recently for €17.99 on Playstation Network. It's been widely revered as one of the best videogames of all time so I went ahead and purchased. That was more than a month ago and I still haven't actually played it yet. That's because I can only afford to have one videogame addiction at a time and my current addiction is still Metal Gear Solid V: The Phantom Pain.

Almost as interesting as The Witcher game is the story of how it was made. It was developed by a relatively small Polish Game Development Studio who by all accounts have been punching well above their weight. The games are based on a series of books by Polish writer Andrzej Sapkowski. I was frankly afraid to start playing this game based on what I'd heard about it. Given how much time I've ploughed into Metal Gear Solid, I could well see myself getting completely lost in The Witcher. Rather than actually play the game, I watched a couple of videos about it.

This led me to reading the books. They're good. They're very very good. If you like Game of Thrones, you'll love Sapkowski's salty fantasy world of The Witcher. The first book I read was 'The Last Wish' - this is the first book in which Yennifer (A sorceress who features in the videogame) makes an appearance. Also recommended is follow-up book 'Sword of Destiny' which features Ciri (also a character in the Videogame). Both books are collections of short stories which were written in the early 90s. The author seems to be ambivalent about the success of the videogame but its success has surely brought him more readers. Were it not for the videogame (which I still haven't played), I would never have heard of these books. Sapkowski's books deserve a wider audience. He's a good writer and the books are fun and entertaining. Highly recommended. I may even some day play the video game of the books.


fantasy, books

Metal Gear Solid

2017/04/17 14:54

We got a PlayStation 4 for Christmas this year. It was 9 years since we last bought a Gaming Console so it was time. I picked up Metal Gear Solid V : The Definitive Edition for €27.99 - a steal.

I'm a fan of Stealth games - I loved GoldenEye for the Wii. I'd never played any of the Metal Gear Solid series, despite having a PlayStation one many years ago. MGS V had been getting great reviews so I gave it a shot. So far I've put about 100 hours into the game. Yes. I like this game a lot. It is surprisingly deep - a game that for the most part rewards slow thoughtful play rather than rushing in all guns blazing. Much of the fun of MGS V is to be had simply sneaking up on sites and surveying the lay of the land from a safe distance, then picking off targets one by one.

It's been almost 4 months now since I started playing and I still haven't become bored with the game. There is a lot to love about this game but it's not without glaring faults. The story is complete nonsense and the overtly sexualized female companion 'Quiet' is a little troubling. The start of the game consists of - for the most part - an extended cut-scene which involves very little actual game-play. The opening cut-scene is about 45 minutes long and is painful. Thankfully, once the game begins proper it's a ton of fun. Each mission has opening and closing credits which remind you that this game was CREATED AND DIRECTED BY HIDEO KOJIMA . This gets a little annoying after you've seen it the umpteenth time.

If you liked GoldenEye for the Wii, you'll love Metal Gear Solid V. Do yourself a favor - if you've got the Definitive Edition skip the pointless 'Ground Zeroes' and jump straight into 'The Phantom Pain' - it's a completely different feeling game. I feel like there's a lot more I could probably say about MGS V but this will have to do for now.



Justice - Woman

2017/04/17 14:47

I've been a fan of French electronica duo Justice since 2008. I've loved both of their previous albums and just got their latest (Woman) on a couple of days ago.

It's an album almost designed for previewing. It's full of sumptuous disco-tinged tracks which sound great for about 20 seconds and when previewed on sites like 7digital and iTunes, hint at great things which never actually transpire. The problem with Woman is that many of the tracks sound pleasant enough, but are lacking something vital - a chorus. It's all verse and bridge but lacks a killer chorus that would truly make it memorable.

It's a pity because Justice have done some great things in the past. This album feels like they're coasting. It's good but not great.




2017/04/04 07:01

On a rainy cold Saturday morning in March 2017, thousands of people queued for hours in the cold to gain entrance to a Gaming Convention. They'd paid a lot of money to attend and many of them didn't get in. The venue could only accommodate 9,700, the conference organiser sold 25,000 tickets. That's Dublin and Irish ah-sure-it'll-be-grand Entreprenurialism for ya.

Inevitably there was a Social Media Backlash™. I wasn't one of those attending but a friend had asked would I be interested in going. It was a Video Gaming Convention and although I play video games, the thought of attending a conference devoted to video gaming does not appeal.

The sight of 1,000s of parents and kids queueing in the cold and the rain that Saturday morning brought me back to Saturday mornings more than 30 years ago. Dublin was very different then (we didn't have a Convention Center affectionately known as 'The Tube in the Cube', and we didn't have commercialy-run Video Gaming Conferences that scalped paying customers). I think 30 years is a suitable time for reminiscing. The 80s is now a long time ago. To my kids it seems prehistoric.

Temple Bar in 1985 wasn't too different to now. It wasn't yet the stag-night goto it became in the mid to late 90s. Some of its landmarks have been there since before I can remember. The Bad Ass Cafe, the record and camera shops, the older pubs, the Project Theatre. There were also a lot more comic shops back then, and of course there was The Alchemist Head - a mecca for anyone who read science-fiction. The Alchemist Head was a small single-story bookshop on Essex street just across the street from the Project Theatre. It kept odd opening hours if I recall correctly - it sometimes didn't open until after 10:30 am. I remember waiting outside and peering through the shop window where the latest books by Douglas Adams and Brian Aldiss were on display. There were also posters on the walls - the iconic image of Harrison Ford clinging on for dear life from a metal beam in Blade Runner.

Blade Runner

What brought me to The Alchemist Head wasn't books but a selection of new and second-hand comics they sold. I'd often go rifling through the 2nd-hand section looking for old issues of 2000AD. I'd occasionally pick up an issue of 'Epic Illustrated' - Marvel's "adult" imprint, which featured stories by Alan Moore and others. As far as I know, The Alchemist Head was the only place in Dublin that sold 'Epic Illustrated'.

A visit to The Alchemist Head became a regular Saturday pilgrimage throughout 1985 and 1986. I think it closed down sometime late in 1986 and reopened a couple of years later on Dame Street but it was a different type of bookshop selling mostly self-help, occult and other speciality books. There were other shops scattered around Temple Bar which sold Comics - there was a shop just alongside the Central Bank with a great selection of new and second-hand comics. I can't for the life of me remember its name but it was also a regular haunt.


Away from Temple Bar on Anne street just off Grafton Street there was of course The Diceman - a game store which specialised in Role-Playing Games. It was - as far as I know - the only dedicated RPG store in Dublin. The Diceman store is less famous than its Mascot - The Diceman. The Diceman was a mime artist on Grafton street throughout the 80s whose job was to advertise the store. He was so entertaining that he kind of became famous in his own right. Unfortunately I think he succumbed to AIDS some time ago.

The Diceman store occupied an old georgian-style building on Anne street. It had a selection of Board Games and wooden toys on its ground floor but downstairs in the basement was where all the good stuff was. The basement was poorly lit and smelled of Incense (I think) but it had everything a 14 year old RPG fan could ever want. Metal Figurines, every RPG you could think of - Dungeons & Dragons, Advanced Dungeons & Dragons, Traveller and many more. There were metal figurines and paints too. All of the RPG supplements and magazines (White Dwarf etc). The same music seemed to always be playing - I vividly remember hearing Billy Idol's "Dancing with Myself" more than once during the same visit.

Epic Illustrated

The Diceman too was not long for this world and closed down not long afterwards. I remember missing those stores - I still do.

Just a few doors up from the Diceman was another 2nd-hand book shop - god there used to be so many of them in Dublin. That's where I chanced upon a horde of 'Warrior' magazines. I was big into 2000AD at the time and 'Warrior' was - like 'Epic Illustrated' - aimed at the more mature reader. It shared many of the same writers and artists as 2000AD. 'Warrior' was where Alan Moore's "MiracleMan" and "V for Vendetta" were first published. By the time I discovered 'Warrior' it had already ceased publication. It ran from around 1982 to 1984/5. Unlike 'Epic Illustrated' , 'Warrior' was not full-color but the writing was great - even better than its American counterpart.


Shortly after my daughter was born, in a fit of nostalgia I bought full sets of both 'Epic Illustrated' and 'Warrior' on eBay. This would have been around 2002 - FIFTEEN years ago now! I still have those sets - each issue in a plastic cover - though to be fair I didn't buy them in Mint Condition (I'm not made of money) and only bought them to re-read and satisfy my nostalgia.

What's prompted all this reminiscing? I sometimes fervently wish I could go back to that time. The book, comic and game shops of my youth are gone for good. On a recent trip to Dublin I drove down Cork street and the Coombe where there was once a shop that sold 2nd-hand comics - you could get real bargains there. Even though the Coombe has changed a lot the store's building was still there but boarded up. Walking down Grafton street I peered along Anne Street but the Diceman sign was not there. I didn't bother to go see what was in its place.

I don't miss Dublin or the 80s per se, just that nebulous time and place when there were things to do and places to go that were just a little off the beaten path.


Gaming, Nostalgia, Dublin, 80s

Serializing Asynchronous Tasks in Javascript

2017/03/29 08:43

You have an Array and an asynchronous task which must be performed on each element in the array. You want the array to process in series. That is - each item in the array is only processed after the previous item has been processed.
You're using Node.js or a system with the same callback conventions/signature.

function series( array, asyncOp, done){
  var len = array.length,
      results = [];
  if (len == 0){
    if (done) {
      done(null, []);

  function each(n){
    asyncOp(array[n], function(err, result){
      if (err){
      if (n < len -1 ) {
      if (done) {
        done(null, results);

Let's create a silly asynchronous function to demonstrate:

function lazyOp( item, next ){
    if (typeof next == 'function'){
      next(null, item);
  }, Math.random() * 2000);

This function will print the item after a random period of time (somewhere between 0 and 2 seconds). If we were to run this lazyOp over an array using forEach() the items would be processed out of order:

[ 1, 2, 3, 4, 5].forEach(lazyOp);

The results might look like this:


Whereas if we run them using the series() function above:

series([ 1, 2, 3, 4, 5], lazyOp);

Each item in the array is guaranteed to be processed in order.


In NodeLand, most operations are asynchronous. That is, they do something and tell you when it's done via a callback function you provide - these operations are usually subject to the vagaries of network or other latencies. Sometimes you want things done in a certain order so being able to guarantee the order in which operations is important.

Isn't there already a NPM package that will do this? Why of course but it was interesting to work out in code how to go about implementing such a function from scratch. It scratched an itch. Sometimes it's fun to just take a problem and start coding - taking a rough, hazy line of thinking, and distilling and crystalizing it in to working code.

Update: Using async.series

As mentioned earlier, there is an open-source module which lets you do this. The async.series() function takes a list of tasks (functions) and performs each in series. If we were to use this to perform the same operation over an array in series, it would look something like this:

var series = require('async').series;
var tasks = [1, 2, 3, 4, 5].map(function(item){
  return function(callback){ 
    lazyOp(item, callback);
series( tasks );

Can this code be improved and/or made succinct? It's javascript - of course it can.


Javascript, Programming


2016/12/31 11:09

So ... 2016. I haven't posted on the blog for a couple of reasons - Kids, Family, Work, much-needed time away from screens - the usual.

Lake Garda Sunset

In Books

A last minute holiday in Lake Garda in the middle of summer gave me some time to read. I remain skeptical of eBooks so brought some paperbacks in my luggage.

Flowers For Algernon - Daniel Keyes

This was really good. As with 'Dune' and other Science Fiction classics, it's been on my radar forever (since I was 10 years old at least) but I only got around to reading it this year. Given it was written in the 60s (like Dune) it has aged really well. It's very moving.

Fairy Tales - Hermann Hesse

I read a lot of Hesse in my teens/early 20s and 'Fairy Tales' has been sitting on my shelf for a couple of years. Maybe I've outgrown Hesse but this collection of short stories was not as good as I hoped. Siddharta, Steppenwolf, and Demian remain three of my favorite books.

Brave New World - Aldous Huxley

This was a re-read. I first read this in 1989 - I was 18 years old at the time and the world was very different then - it blew my mind. It hasn't aged well over the intervening 27 years. There's still some interesting ideas but it feels a little 'Jules Verne' now.

Seveneves - Neal Stephenson

This was a long read. It's contemporary science-fiction set in a not-too-distant future where the moon shatters, prompting a race against time to create an off-world survival ark. The first 2 thirds of the book are riveting, the last 3rd not so much.

Helliconia Trilogy - Brian Aldiss

I began reading this on and off a couple of months ago but haven't yet finished it. It's good but I just don't seem to get the time to read as much as I'd like.

My own book Writing Minecraft Plugins in Javascript hasn't exactly been flying off the shelves. Computer books of a technical nature tend to have a short shelf-life and become obsolete, that's why - for much of my book - I focus on teaching Javascript (which isn't going away anytime soon). The latter 3rd of the book introduces Java and the CanaryMod API which sadly is no longer being actively developed. Nonetheless, ScriptCraft works just fine with SpigotMC which is being actively developed.

In Running

I finally bit the bullet and signed up for a Marathon in 2016. I did it mostly because it was getting weird having to explain to friends and colleagues (who know I run) why I hadn't yet run a Marathon. I did the local Marathon (Cork City) in June. It was hot and hilly, I wasn't as prepared as I could have been so the arse fell out of it around mile 10. I finished in 4 hours 52 minutes. Definitely room for improvement.

I ran just over 1,000 miles this year.

In Work

This was my 6th year at IBM. The work continues to be interesting and the people are great. In an industry that has its fair share of sociopaths, I've never encountered any at IBM. Maybe I've just been lucky but the people I've worked with at IBM have been an all round decent bunch. This year I ran a couple of NodeJS workshops in Cork and Galway. Hopefully in 2017 I'll devise and run an AngularJS workshop, among other things. Our project migrated to using Git for revision control recently. It's been an interesting move. Git is a revision control system that exposes a lot of its internals - so much so it can be thought of more as a revision control construction set. If revision control systems are your thing, you'll love git. I've been making a concerted effort to master git over the past few weeks. Despite having a github account for a couple of years, and maintaining a repository (ScriptCraft) with 100s of forks and 1000s of stars, I never really understood git until very recently.

In Miscellaneous

I finally got around (just this morning actually) to updating all of my domains to use HTTPS. It was much easier than I expected thanks to LetsEncrypt.

This Christmas I haven't spent as much time working on ScriptCraft as I'd hoped. I do feel a little guilty about not coding in my spare time - but not that guilty.

The best software developers I know are always hacking over the holidays.

True story.
-- Joe McCann on Twitter

Instead I've been playing video games - the latest generation. There was a family surprise underneath the Christmas tree this year - a Playstation 4. It's been 9 years since we last got a console (Nintendo's Wii), and 18 years since I got a 1st generation Playstation - so yeah - it was time.

I've been playing Star Wars Battlefront (in split-screen mode with my son Sean) and TitanFall 2 which is every bit as good as I'd hoped. I got Metal Gear Solid V but haven't yet played it very much. Rocket League is also good chaotic fun.

Hope you all have a great 2017.



Paul Higgins 1939 - 2015

2015/08/06 19:56

I was 20 minutes into the 3 hour drive to Dublin, just outside Watergrasshill on the M8 when I got the call from the nursing home. It was Janet, the head nurse:

Hi Walter, are you driving right now?
Can you pull over?

I pulled in to the hard shoulder and braced for the news. I knew his health was failing, I'd been up to see him with my kids just days previously. He had seemed in better health than I expected, he asked the kids about school.

It's bad news I'm afraid. He's just passed away.

I noted the time, it was 11:10 am on an overcast sunday morning. The motorway sign said I was 1 KM from Watergrasshill. He passed away peacefully in his sleep. The nursing home nurses were present by his bed.

I was 1 kilometer from watergrasshill, 2 hours and 40 minutes away when it happened.

He was born on September 1st 1939 in Dublin. He grew up in Crumlin, the youngest of 8 - "the nipper". This is a picture of him on a motorbike taken on Saul Road. He was 12 years old. He and my son Sean look uncannily alike.

Dad on Bike, Saul Road, 1951

I had never seen that picture before until yesterday, the day I buried Dad. I love that picture because it surprised me and in doing so reminded me of what I'll miss most about him - he was full of surprises.

The day after a funeral is probably the roughest. I woke up this morning with the distinct feeling that something of me had been buried too. I feel lessened.

One good thing that comes of funerals is the meeting of the wider family. It was great. They are the best. We should meet more often.

This is a picture of my Dad taken at our wedding 15 years ago. He was 60 years old and still in rude health and full of mischief.

Dad aged 60

He doted on his grandkids Kate and Sean - Always sent them cards and gifts on their birthdays and at Christmas. They took the news hard.

He was a dad, a brother, a husband and a doting grandfather. He'll be missed by us all.



Writing Minecraft Plugins - The Book in Print.

2015/04/18 07:47

Yesterday, author copies of A Beginner's Guide to Writing Minecraft Plugins in Javascript arrived in the post. A courier dropped by with a cardboard box of 24 copies, and an additional copy in a Jiffy envelope. My youngest had some friends over for his 9th birthday and couldn't wait for me to get home, so Ursula took out the first copy from the Jiffy. To be fair I would have asked her to do this anyway when she called me on the phone. I was like a kid at Christmas when I got the call.

first copy with box

What follows are some photos and short notes on the book. As you'll probably guess, I'm a bit of a bibliophile. I love books - not just technical books. Having my very own technical book with my name on the cover is, well ... something.


One of the things I explain early in the book is Modules. The commonjs module system (used by Node.js and ScriptCraft) is the most concise and elegant module system I've ever used. Teaching modules and modularization is usually an afterthought when teaching programming to beginners but it's such an important part of programming and it's done so well in CommonJS that I wanted to cover it in the first half of the book.


The book is in full color throughout its 310 pages and is printed on high quality paper.

full color

Source code listings are - for the most part - short. This screenshot shows one of the medium size code listings - an example use of Javascript's switch statement:

code listing

The book has many different types of content, source code listings, tables, diagrams, screenshots, side-notes and so on.


This is a full page table and source-code listing on opposite pages.


Peachpit have done a wonderful job on the production of this book. The cover, spine, paper quality and layout are what you'd expect from a publisher that specializes in Photography and Education. This book looks and feels better than I dared imagine.


I'm a big believer in books - actual physical books - as a way to learn and be inspired. I tried to write the kind of book I would have wanted to read when I was 12 years old and just starting out programming. I can only hope now that this book ignites the programming spark in readers and maybe - just maybe - inspires some of the next generation of programmers.


ScriptCraft, Writing, Minecraft, Javascript

Never Invented Here

2015/03/29 11:32

Michael O. Church on the 'Never-invented here' syndrome prevalent in Software development organisations:

if engineers are micromanaged to the point of having to justify weeks or even days of their own working time, not a damn thing is ever going to be invented, because no engineer can afford to take the risk; they’re mired in user stories and backlog grooming. The core attitude underlying “Agile” and NeIH is that anything that takes more than some insultingly small amount of time (say, 2 weeks) to build should not be trusted to in-house employees.
-- Never Invent Here: the even-worse sibling of “Not Invented Here”

... and the problems of job satisfaction and employee retention in same:

In a never-invent-here culture that just expects programmers to work on “user stories”, the programmers who are capable of more are often the first ones to leave.

The whole blog post is very nuanced and well worth a read. I'll leave with this...

The failure, I would say, isn’t that technology companies use off-the-shelf solutions for most problems, because that is quite often the right decision. It’s that, in many technologies, that’s all that they use, because core infrastructure and R&D don’t fit into the two-week “sprints” that the moronic “Agile” fad demands that engineers accommodate, and therefore can’t be done in-house at most companies. The culture of trust in engineers is not there, and that (not the question of whether one technology is used over another) is the crime. -- Never Invent Here: the even-worse sibling of “Not Invented Here” | Michael O. Church


Programming, Agile

Minecraft and Trampolines and Javascript Oh My!

2015/02/15 16:50

This has nothing to do with Reginal Braithwaite's Trampolining in Javascript. Just a fun experiment I've been working on for a forthcoming ScriptCraft Workshop.

The goal of the workshops is to whet kids' appetite for programming. Kids aren't necessarily interested in programming for its own sake but they sure are curious about Minecraft and Modding and making cool stuff.

In the upcoming workshop I'm going to do the usual introduction - some basic building functions. The self variable and properties ( - the player's name, self.motionY * 2 - sets the player flying into the air) and some basic maths in javascript (addition, multiplication - the usual).

The /js self.motionY = 2 statement usually elicits a few oohs and aahs because it gives immediate visual feedback (See Bret Victor's Inventing On Principle (skip to 10:00)).

Maths on its own can be hard to engage with but if you take Muliplication and combine it with something like the Player.motionY property you can see how the principle of multiplication applies to trampolines. When you first step into a trampoline, the first jump is small but as you jump higher and higher there's a multiplier effect as each consecutive bounce makes you bounce higher.

The workshop will take the kids step by step through the process of adding a new object to the game - a Trampoline. The kids will choose which material/block-type should be used for the trampoline - two good candidates are Sponge and Slime but participants can choose something else if they like.

Initially the trampoline won't actually be bouncy. Once the trampoline() function is added, kids jump aboard but will probably be disappointed because it doesn't behave like a trampoline - there's no 'bounce'. This is where I explain Event-Driven Programming - Events or 'Hooks' are ways to tell the game you want it to run some code when a particular thing happens, such as when a player breaks a block or a player moves.

So I introduce a maybeBounce() function which will be called when the player moves. The 1st draft of the function checks to see if the player is standing on a bouncy block (slime or sponge or whatever) and 'bounces' the player in the air by setting their motionY property.

The next phase is to improve the trampoline behavior. Initially players all jump the same height no matter how many times they bounce. This is where multiplication comes in - I'll explain how multiplication can be used the make the in-game trampoline more realistic - each successive bounce will be higher than the last.

I like this workshop because it covers objects and properties ( the self player object and their .motionY property ), event-driven programming and - crucially - how Maths can be applied to improve gameplay.

The final draft of the workshop code is embedded below.


Minecraft, Javascript, ScriptCraft

CanaryMod and ScriptCraft Quick-Start

2015/01/31 21:56

CanaryMod has a lot of configuration options and its default configuration is very restrictive (compared to say - Bukkit; but there are good reasons for this - CanaryMod has built-in permissions management so it make sense that the default config is hardened). For example, players who join a canarymod server automatically belong to a 'visitors' group which has very few permissions. Visitors can't build or break blocks.

I recently added a new slash() module/function to ScriptCraft which lets plugin authors run other commands from their scripts. For example to create a startup script that grants extra permissions to visitors, create a file called init.js in the scriptcraft/plugins directory:

The above script will let visitors build and also execute javascript. It will also give opreator privileges to any players who join the game. You definitely don't want to allow this unless you're working with your own server and are only sharing with trusted friends.

There are a couple of other configuration changes you'll probably want to make to CanaryMod if you plan to use ScriptCraft for building or want to have a creative server. The following entries in the config/worlds/default/default_NORMAL.cfg file will make a flat world (good for building) with no monsters or villagers and with a default game mode set to CREATIVE.


You'll need to delete the worlds/ directory after you've made these changes so that CanaryMod will generate a new world with these settings.


ScriptCraft, CanaryMod, Minecraft

The Two Pillars

2014/10/21 13:55

If you are working in JavaScript and you’re creating constructor functions and inheriting from them, you haven’t really learned JavaScript. It doesn’t matter if you’ve been doing it since 1995. You’re failing to take advantage of JavaScript’s most powerful capabilities.

You’re working in the phony version of JavaScript that only exists to dress the language up like Java.

The Two Pillars of Javascript

A thousand times this.


Javascript, programming

The pleasure of not knowing

2014/09/30 13:16

During the last Irish property bubble, there was an ad on TV which showed people on the top deck of a double decker bus. Each person stood up one by one and admitted to not knowing about something or other. The last man stood up and admitted:

I don't know what a Tracker mortgage is.

I don't know what Growth Hacking is. I could easily find out if I wanted to know but I don't want to know. I'm quite comfortable about not knowing what this particular thing is because it has only recently impinged the stream of things I read or hear about. If I were to be honest, I even feel a little smug about not knowing what Growth Hacking is. I've added it to the growing list of things I'm peripherally aware of but have no wish to know about. I suspect that along with many other new things, I could die with no regrets about not knowing what 'Growth Hacking' is.

I have to wonder at my pleasure in not knowing about the latest "thing" - is it a mark of getting old? Is this what happens when you get old? You become comfortable (content even) in not knowing certain things?

In this day and age it takes an effort of will to not know what something is. Yes - willful ignorance. I'm writing this in a browser window. I could stop writing the rest of this sentence right now and - with just a few keystrokes in another browser window - google it. But - perversely - I won't.

I'm sure that if Growth Hacking is important I will come to know about it in the fullness of time but for now I'm quite happy not knowing what it is.

No. I would not like you to google that for me.


The Internet

Writing Minecraft Plugins: The Book

2014/09/26 08:41

I wrote a book.

A Beginner's Guide to Writing Minecraft Plugins in JavaScript

I wrote a book to teach Javascript Programming. The book is aimed at beginners of all ages. It's a technical book but assumes the reader has no programming knowledge. The book teaches Javascript and how to use it to create Minecraft Plugins.

It was due to be released this November but recent developments in the world of Minecraft Modding - the CraftBukkit DMCA takedown notice to be exact - mean the book's release date has been postponed.

The book requires you to install ScriptCraft so readers can write Minecraft Plugins using Javascript. ScriptCraft in turn uses CraftBukkit which is no longer available due to legal reasons. This means I have to port ScriptCraft to another modding framework, update the source code listings in the book and the accompanying text. I've already begun this process. I'm currently working on porting ScriptCraft to work with CanaryMod, a Minecraft server which supports plugins. The ScriptCraft port is going well though it's not yet complete. I honestly don't know how long this will take. It might take as little as 1 month or as much as 3 months.

The book was in production copy review phase (I was reviewing final production PDFs) when the news about CraftBukkit's takedown notice broke. Writing the book has taken a long time and a lot of work. When I heard about the takedown notice I contacted the publisher to let them know. In a way I'm glad the takedown didn't happen later because publishing a book which includes download instructions for software which is no longer available would not have been good for anyone: readers, the publisher or myself.

To say I'm disappointed about the postponement is an understatement. I love technical books - actual physical books - and to be able to say I wrote a Javascript book ... well that was something I was proud of. I was really looking forward to the book's release. It's a full-color book with lots of supporting diagrams and screenshots, printed on high quality paper. It's the kind of book I would love to read if I were 12 years old and interested in Minecraft and modding.

Anyway, the book's release date is postponed for now - I hope it will be available soon. I'm working on it.


Minecraft, ScriptCraft, Writing

ScriptCraft is Moving

2014/09/19 06:57

Earlier this month, CraftBukkit received a DMCA takedown notice from one of its open source contributors. I won't go into the details here but it means that it's highly unlikely there will be further development of CraftBukkit. The rest of the team have left the project and Microsoft just this week purchased Minecraft. CraftBukkit is pretty much dead.

So where does that leave ScriptCraft? ScriptCraft is a thin layer of Javascript on top of CraftBukkit. I chose CraftBukkit as the base layer because it is...

  1. Server-based
  2. Easy to install
  3. Has a sane API.

All 3 of these are important. I've been looking around for alternatives that meet these 3 criteria and have chosen Canary Mod as the next plugin framework which ScriptCraft will be ported to. I've been busy working on the port this week (the few hours I can snatch here and there between work and family commitments).

Canary Mod's API is very similar to Bukkits which makes porting that much easier. I don't know how long it will take - these things take time. What I do know is that Canary Mod won't be the only platform I eventually port ScriptCraft to.

Since CraftBukkit's demise, a new project has started up SpongePowered which looks promising but there's not a whole lot of code there just yet. GlowStone is also promising - it's been very active lately and is already bukkit compatible so ScriptCraft kinda sorta works already with it. The big one will be the Official Minecraft Plugin API which I hope Microsoft will begin working on soon.


ScriptCraft, Minecraft, CraftBukkit, Canary Mod

Platform Game

2014/09/13 10:08

Minecraft as a Platform

In all of the coverage I've read about Microsoft's rumored bid to acquire Mojang, I haven't yet seen any talk of Minecraft as a Platform. Minecraft: the Platform, is far more interesting than Minecraft: the Game. It's interesting to Microsoft, it should also be interesting to other big players in this space.

When I say Minecraft is a platform I mean it in the same way we say the Web is a platform. If you don't believe Minecraft is a platform then go ask any of the thousands of plugin developers and server administrators who are in freefall since the recent DMCA Takedown.

Minecraft has become Important - too important to be controlled by a boutique game development company in Sweden. The thousands of developers and administrators who build on top of Minecraft now see this. Microsoft see this. Learning the Minecraft protocol and how Minecraft servers work, will be important to software developers in the same way learning HTTP and how web servers work is today. There, I said it.

I'm ambivalent about Microsoft acquiring Mojang. Will they Embrace and Extend Minecraft as they've done with other categories? Let's hope not. On the other hand, some adult supervision and a Plugin API would be welcome. Mojang have the financial resources but lack the will and focus needed to publish and support a Plugin API. Perhaps Mojang themselves don't realise just how important their little game has become.

An interesting thread on reddit spells out the alternatives for developers who want to build on an open Minecraft platform. Me? In my down-time I'm going to stop reading the book I was reading and go read some source code instead. It may come in useful some day.


Minecraft, Microsoft, Platforms, The Future

George Orwell: Why I Write

2014/06/17 09:08

Writing a book is a horrible, exhausting struggle, like a long bout of some painful illness. One would never undertake such a thing if one were not driven on by some demon whom one can neither resist nor understand. For all one knows that demon is simply the same instinct that makes a baby squall for attention. And yet it is also true that one can write nothing readable unless one constantly struggles to efface one’s own personality.
-- Collected Essays, by George Orwell : part47



Nashorn Vagaries

2014/06/08 09:52

JavaScript sometimes causes me to doubt my sanity. I spent a good few hours debugging weird behavior in Nashorn's JS engine yesterday. JSON.stringify() wasn't doing what it was supposed to.

In scriptcraft I expose the JS engine as a javascript variable called __engine . That is - you can access the JS engine from javascript itself and do something like this:

var x = __engine.eval('( { "names": ["tom", "dick", "harry"] } )');

I noticed something odd - An object read this way was not being output correctly by JSON.stringify():

console.log( JSON.stringify ( x ) )

outputs "undefined". Yet if I construct the same object using JSON.parse:

var y = JSON.parse( ' { "names": ["tom", "dick", "harry"] } ');

and output it using JSON.stringify() the output is fine. So basically, what I think is happening is that in Nashorn:

var x = __engine.eval('( { "names": ["tom", "dick", "harry"] } )');

returns an object whose "names" property is a Java array, not a JavaScript native array so it can't be stringified by JSON. The subtle differences between Nashorn and JRE7's JS engine are driving me nuts right now.


JavaScript, Nashorn, ScriptCraft


2014/05/14 14:05

I've seen this happen...

Once a programming team has adopted a methodology it’s almost inevitable that a few members of the team, or maybe just one bully, will demand strict adherence and turn it into a religion. The resulting passive-aggression kills productivity faster than any methodology or technology decision.
-- Typical Programmer - Why don’t software development methodologies work?


Programming, Agile