Six tips for building the first product at a startup

Many tech startups begin with a naive approach to software development, either because their developers have only worked on established large software projects, or because they have never worked on anything beyond their own personal projects. Either way, the first iteration of the software behind the startup (the Minimum Viable Product or MVP) can be a badly engineered, unmaintainable shambles, yet it forms the basis of the business for many years to come and may ultimately lead to the company’s demise.

Here are some lessons learned in the first six months at a tech startup. …


Procedural generation of an infinite world

Procedural generation is a technique that can be used in video games to create an infinite amount of data for maps, textures and sounds to make game worlds that never end.

As described in my previous post, I recently entered the JS13k Games competition and I wanted to make a game that felt big but would fit within the 13 kilobytes size limit imposed by the competition. I chose to use procedural generation since it meant I could generate the game world within the game code, thereby keeping the size of the overall package small.

Image for post
Image for post
A screenshot from my JS13k game “Back from Kooky Island” showing the procedurally generated terrain

Here I discuss some of the background behind how I did it. Although I used procedural generation to make the terrain for a 2d platform game, the techniques also work for generating game structures, sprites, textures and sounds. …


Image for post
Image for post
“Back from Kooky Island” — JS13k Games 2019

During my daily commute to and from work I have been writing a game to enter into the Js13k Games competition.

The competition runs for a month every year, at the end of which entrants must submit a complete game using only 13 kilobytes. The competition has been running since 2012, and this year 245 games were entered.

The standard of games in JS13kGames varies but is generally high, with some of the games being as good as commercial products. …


Image for post
Image for post
Photo by John Tuesday on Unsplash

I recently went to a conference where one speaker began their talk with “Some people say Javascript isn’t for Machine Learning. I’m here to tell you that it is….”

That got me thinking. Why are people so keen to have solutions to problems available in a particular language? Why focus on the language not the problem? Then I realised — we make a big investment when we learn a programming language. We put in so much effort that the language begins to define us. We think of ourselves as “Javascript developers,” “Java developers,” “Ruby developers.” …


Kind of…

Image for post
Image for post
Photo by Alex on Unsplash

State can be thought of as any value that a system “remembers”. In Javascript, variables are used to keep state. The browser also keeps its own state, for example, the URL of the current page, the content of the page, whether a link has been visited before, and which form element has keyboard focus.

CSS doesn’t define any way to keep state. CSS has some notion of variables, but these are actually more like constants, and it doesn’t make sense to do things like:

body {
--my-size: calc( var(--my-size) + 40px);
}

The purpose of CSS to alter how elements in the DOM get transformed into pixels on the screen. This transformation process is stateless, meaning that, given the same input, it will produce the same output. …


Drawing pixel graphics on an HTML canvas

Image for post
Image for post

As I described in a previous post, Web Assembly is intended as a target language for compilers, not as a general-purpose language for programmers. In other words, you’re not supposed to write programs in Web Assembly itself but instead write in a higher-level language then compile it into Web Assembly.

I first met assembly languages on 8-bit microcomputers where they were used to write software that ran as fast as possible on what was by modern standards very slow hardware. Since then assembly language has had a special appeal to me, so even though Web Assembly is not intended as an application programming language, I wanted to have a go at programming with it. …


What is Web Assembly, and what is it for?

Image for post
Image for post
Photo by Alexandru-Bogdan Ghita on Unsplash

Before Web Assembly

For over twenty years, the only programming language universally understood by web browsers was Javascript. Anyone wanting to program for the browser either had to write in Javascript or else use a tool to convert (compile) their preferred language into Javascript.

Either way, a Javascript interpreter (runtime) needs to examine the running program in order to map Javascript's syntax and abstractions to the memory and processor of the underlying hardware. …


Image for post
Image for post
Photo by Annie Spratt on Unsplash

Here below are some tips on how to get the most from Bash. I expect some of them will work in other shells too.

Navigation

cd -

pushd

popd

cd - changes to the last directory you visited. It’s really useful for moving back and forth between two directories. pushd and popd are similarly useful, and they store the directory on a stack so you can retrace your steps as you navigate your way around the file system.

Set the shell title

Here is a function you can put in your .bashrcfile.

function title {
echo -ne “\033]0;${1}\007”
}

You can use it like title foo to set the title, which will normally appear as the window title (in a graphical…


Image for post
Image for post
Photo by Oleg Sergeichik on Unsplash

The following is a simple command that I find useful to clear out unused node_modules directories. I have quite a few NPM projects on disk, but most of them aren’t being actively worked on, so to free up space I delete the contents of these directories. I can always re-populate them later as I need them, using the usual npm install.

find . -type d -name node_modules -exec rm -rf {} \; -exec mkdir {} \;

WARNING: This deletes files from disk, so use it at your own risk!

This uses the find tool to recursively search the current directory and all its subdirectories for directories named node_modules. It removes these directories and recreates them, which has a similar effect to deleting the contents of each one. …

About

Alexander Curtis

Software Developer

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