Finding a way

I regularly wonder if I should simply code more. Build little things for fun, without any pressure of reaching a "finished" state (whatever that means).

Most of the time, I choose not to code. And, as we all know, you become better at the things you do.

Well, I went against habits for a few days and created a true off-to-the-side thing for fun and nothing else.

The core is a very straight implementation of Wikipedia's pseudocode for A*. Around this, I built enough of a frame to allow me to play: altering a map, setting start and end points, clicking a button and watching the result.

I started right at that core, translating pseudocode into real code line by line, gradually building up and out until I had something capable of producing (post debugging) a visible result.

Here it is, right on Github.

About the language

I naturally came to thinking about pathfinding from the direction of games. I find it hard to think of pathfinding without visions of C&C units rolling across a landscape.

Thinking about games, it is not strange to start thinking about platforms, performance, about where I would like to play the finished game ancestor.

Shelve all those thoughts, this is about play and exploration. I copied the pseudocode into a text file, and the real language I happened to start writing in was Javascript. It was hardly even a conscious choice. It was the path of very least resistance for me right there, and thus the right choice. If I am to play, there has to be as little as possible in the way of distractions. The very first times I ran my code, I pasted it into the browser console of a page that happened to be open. Then I quickly created a minimal HTML page to make things a little more convenient.

At no point did I, for example, pick a project name, select a template, set up a build system, run a server or research a framework.

My goal was to play, not package, publish or even finish.

A final point

If you look at this and start thinking about code quality, performance, utility or other such aspects: Congratulations, you are missing the point.