or The art of using Baby Steps and other strange programming principles

What about Bob?
What about Bob?
What about Bob?

Over the years writing code, I have been testing various programming principles. Some I rejected, others I adopted and others I adapted. I also invented some.

It is not enough for a principle to be very good, it needs to be remembered or it will not be used. I believe that the most remembered principles are those that are imported from the everyday life. And if they are associated with something nice or have a funny name, more we tend to use them. And lighter our work becomes.

The Chuck Berry principle

The right architecture for handling mouse and keyboard events

Messy event handling
Messy event handling
Messy event handling

Simple Application

The browser (JavaScript) is very helpful about handling user input. For example:

var doneButton = document.getElementById(“done”)
doneButton.onclick = function () { sendDataToServer() }

This is a simple and straightforward code that works perfectly well for the following context.

  1. The user spends a minute filling out a form with his data.
  2. The user clicks the “done” button.
  3. The user waits two seconds for the page to be updated, which he considers very acceptable.

Making a living in the stock market

They may be an excellent choice, but you should be aware of the catches

Photo by Markus Spiske on Unsplash

This is the seventh article of a series. The previous article is “Compound Interest: Natural Mathematics or Pure Greed?”.

The evaluation

We think that 100 golden eggs is a good price to pay for a magic golden goose that will provide 10 golden eggs per year, forever. And 200 golden eggs is equally a good price for the one that provides 20 golden eggs per year, forever.

Now, what is the good price for a golden goose that has an increasing production each year? …


I had played the Pandemonium mission of Heroes Of Might and Magic II dozens of times, barely surviving more than one week. I thought the mission was impossible to accomplish. A mistake or bad joke from the game producers. Then, after learning more about the game and trying the mission again and again and… I finally figured out how to win.

Pandemonium — Day One

This mission really deserves its name. 21 heroes from 4 factions appear on the initial screen. In 3 of the factions, including yours, each hero has a different vocation than the others.

Before playing, which vocation to choose for…


Arrax The Jerk. This mission of Heroes of Might And Magic II is unique in its kind. There is only one enemy hero. He has very, very strong barbarian troops and he never leaves his castle.

Very often, on the first day or second day of each week (or both) Arrax will steal gold and *huge* amounts of ore, wood, crystal and/or gem. Now you know why he is considered a jerk.

Arrax The Jerk Castle

I really hope that you have already tried everything you could do before read this walk-through. I don’t want to spoil the challenge for you.

This Walk-through

There are many…

I really like Linux Mint.

Beware of Debian: it says it will protect your current data, but it erases everything :(

How to easily create abstract mosaics from photographs

Mosaic 1

Just direct your browser to BobSprite and press the red button to open the editor.

Timing logic and animation

Programs like video games have complex logic (mechanics) and animation. In this article, we will examine some principles about timing. This subject is not hard, but maybe very tricky if we don’t follow some basic rules.

This article is suitable for any programming language, but a few parts are specific to JavaScript.

Photo by Andrik Langfield on Unsplash

Small convention

In this article, the word “mechanics” refers to the game logic; how much life has the avatar, for example. While the word “animation” refers only to the visual aspects; the sprites that are drawn on the game canvas. The animation is supposed to match the mechanics.

The main loop (the foundation stone of timing)

How to handle the overlapping of source lights in a 2.5D browser game

Lost In Maze (browser game)

In this article we will see how the light effects of the browser game Lost In Maze were made, in plain JavaScript, not using any library or WebGL.

General performance

Drawing sprites (images) on the browser canvas is a very efficient process. We can rely on it as long as we don’t abuse it.

Due to the 2.5D nature (perspective) of Lost In Maze, it is not possible to draw just a part of the canvas: there is always some missile flying among trees, for example. …

Joana Borges Late

I am interested in computer programming and production of browser games. Also I am a fan of https://www.bobsprite.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store