Michael R. Cook Ruby and Golang Developer

Category: General

Reverse engineering ZX Spectrum (Z80) games

The home computer was born in the early 1980’s and in England this came in the shape of the ZX Spectrum. Along with it came the birth of the British video game industry. Although I had a ZX81 the year before, it was the ZX Spectrum I received as an xmas gift in 1983 that got me hooked on games, in particular the classic Manic Miner; a simple, addictive, and deceptively difficult platformer.

Miner Willy meets the Kong Beast

A year and a half ago I found the Skoolkit disassembly toolkit and one of the examples was the disassembled source code for Manic Miner. As I’d recently started learning to program in C, I thought it’d be a great learning experience to port this classic Z80 game to the C language. After some months I had a working version of Manic Miner written in C and using SDL2.

Porting Manic Miner was a lot of fun and it’d given me a greater understanding of how these early assembly games were written. It had also piqued my interest for how these old Z80 games are disassembled so I decided to give it a go myself.

There are many speccy games to choose from, such as Jetpac, or the classic Knight Lore, but that had been disassembled by others already, so for my first disassembly I decided on Cyclone (the sequel to TTL - Tornado Low Level). Although TLL was the more popular of the two, I’d always preferred the less frantic Cyclone. I thought this would make an interesting project, especially due to its isometric game view.

Cyclone game screens

As of writing, this project is not complete, but I wanted to share some of the tehniques I’ve discovered so far…

Read more...

Go vs Java Performance Comparison

Post Image

For the past five years I’ve been building software in Ruby, it’s a great a language to work in and for many situations its performance is more than adequate. Recently though, I started to encounter situations that would benefit from something with a little more oomph! There’s plenty of languages I could choose from that’d give a good speed boost, and after much consideration I whittled the list down to Go and Java.

I’ve been playing around with Java for a couple of months (just some casual learning really) and I have no experience what-so-ever with Golang. To allow me to gain some real world experience, as well as something to let me gather performance data of each, I decided to write a small test app, and share my test results here.

I won’t be going into details on why I chose Golang and Java (speed was just one of the criteria), but I will give you a little background on the app I wrote to test them.

UPDATED 2015-11-21: now includes benchmark results for both Go 1.4.2 and 1.5.1.

Read more...

Which is the Best Text Editor?

If you’re new to programming then I’ll bet one of your first questions has been, “what editor should I use?” I’m sure you went off to all the forums and no doubt you got answers such as “whatever you feel mostly comfortable with” or “just pick one and try it” - you may even have been lucky enough to start an editor flame war.

When starting out on your software developer career these kind of responses don’t help one iota, and can become frustrating. You just need someone to tell what to use - at least until you become more experienced. Unfortunately, it really does depend. Still, in this short post I’ll give you my own opinions, which will hopefully help you in making that decision.

Before we get started I’ll tell you the editor I use, or, more accurately the editors I use. My day-to-day editor is Vim, though I use both SublimeText and IntelliJ IDEA as well.

Editors fall in to two categories; straight up Text Editors and IDE’s.

For my day-to-day work I use Vim. This is a highly configurable text editor built to enable efficient text editing, with a medium/difficult learning curve. It’s not as crazy to learn (or as powerful) as Emacs, but you can get up and going in a relatively short time, its mode based editing is great for reducing RSI health issues, and for me, it’s the perfect editor for coding in dynamic languages like Ruby.

Read more...

Learning a New Programming Language

Back in 2010 when I started learning Ruby I was mostly just converting old Perl scripts for my custom ebook toolchain. Shortly after this I rebuilt the original epubBooks.com PHP web application in Ruby on Rails. Since then I’ve written a number of Rails applications including my own self-publishing Flash Fiction service; Drablr.com. As you can see, all my current experience is with dynamic programming languages, there’s not a type in sight.

For the last few years I’ve made an effort to follow respected developers, reading their books/blogs and watching shaver conference talks they give. Every one of those people seem to know a multitude of languages. As 2014 comes to a close I figured it was time I took the leap and expanded my experience with learning a new language.

What’s the best programming language to learn?

From all of my peers I don’t think there’s one who hasn’t worked professionally in at least one statically typed language, so this seems a good way to limit which ones to look at. Still, the choice is quite considerable. Do I go with Objective-C and look to iOS development? Perhaps I could check out Rust or Go? What about jumping into C++? Heck, why not take on the grandaddy of them all, plain old C?

After some months procrastination research, I decided that although learning a newer language like Rust would be pretty cool, it’s probably best to stick with something more mainstream and mature so that I can benefit from the wealth of resources available.

This leaves us with C, C++ and Java.

C was ruled out pretty early on as although it’s a fast and hugely flexible language, it’s not OO. Object-Orientated languages may not be the only programming paradigm around but I’ve learned a great deal about OO from my Ruby experience and it won’t do any harm to remain in this area for the next few years at least.

One down, two to go: C++ and Java.

Read more...

About Me

Hi, my name is Michael and this is my personal blog. Here I’ll be posting various coding thoughts and experiments; everything from writing blogs in Ruby, to Go tools and Z80 Assembly. This site is powered by Thunderaxe, a blogging platform I built using the Roda Ruby framework.