If you haven’t heard the term before it’s used to describe a user or system flow that goes through all the expected steps without any issues. Everything else is referred to as an edge case, or a state that the user or the system entered that was unexpected or unplanned, which may even trigger an error report.Continue reading ““Happy path” engineering”
An Abstract Syntax Tree (AST) is a tree representation of the structure of a piece of code used mainly in compilers. ASTs can also allow us to traverse existing code and use the information collected to auto-generate new code, which we are going to do in this post! The
structor is a command line utility we are going to build that given a domain package with struct definitions it automatically generates getter and setter functions for the fields of the structs.
A couple of months ago I decided I wanted to learn a bit more about music so I decided to learn how to play the piano. This is an entirely new world for me, as I have practically zero prior knowledge. Little did I know then of how similar my experience was going to be to when I started writing code!Continue reading “What learning to play the piano reminded me about software engineering”
Arrays and Slices are two of the most common data structures you will ever use if you program in Go. They share a lot of properties as slices are ultimately build on top of arrays but also quite different.
A simple definition of Go routines is found the “Tour of Go” section about concurrency:
a Go routine is a lightweight thread managed by the Go runtime
Now if you have not come across threads before, threads is a way for a program to run parts of itself in some sort of concurrent way. In this post we are going to examine the differences between running a program sequentially, using Go routines and Wait Groups and we are going to talk about thread safe access to a data structure. So… Let’s get started 💪!Continue reading “Go routines and thread safe data structures”
Writing code and building software is fun no matter which language one uses. But what we have found is that there is no “language to rule them all”. There are a number of languages out there each with its own quirks, strengths and weaknesses and that’s just amazing.
So where does that leave us as software engineers? We will probably need to pick up more than one languages as we go along, but what’s the best way to go about that?Continue reading “5 things to sort out as a multi-lingual software engineer”
A lot of things in life are a matter of perspective and visibility and the same applies to variables in Go 😅. But what is a variable’s scope, how is it defined and what does it mean to shadow a variable in Go?
Let’s (very) loosely say that the scope of a variable declares where this variable is visible from ie. if we have declared a variable at the top of the file then it’s visible from within the entire code of that file.
We can go even deeper than that though and we can break this question down into Go specific terms.Continue reading “Variable scopes and shadowing in Go”
Problem definition: Given a slice of integers sort them in ascending order
Bubble sort is an iterative comparison algorithm that sorts the elements by swapping them around if they are out of order. If a larger element comes before a smaller one => swap them and move on to the next position of the array.Continue reading “Sorting in Go using Bubble sort”