Photo by Matt Seymour on Unsplash

We all know that with go, we need a “main.go” file to execute in order to run our application. And though we can hold everything within a main.go file, as our app gets larger in size and more functions are made things could get really messy really fast. As good developers, we want to have clean, easy to read code and we want to separate our concerns and abstract the functions, and organize them into different groups.

package mainimport "fmt"func main()…

Speech recognition is when a user is able to speak into their computer’s microphone, the speech gets processed into something the readble for the computers on the other end. The servers on the other end then return the interpreted speech into text! Now before I go any further I do want to bring up the fact that this API is not available on all browsers. Check here if you browser is compatible. …

Photo by Nick Fewings on Unsplash

Like many other programming languages, there are two ways in which we can pass data in Go. You can either pass by value where Go will make a literal copy of the data you want to use(this uses more memory because it is making a copy of the data) or you can pass by reference where you are referring to the address in memory in which the data itself is stored rather than making a copy of the original data. …

Photo by Sebastian Staines on Unsplash

Why use the Sliding Window?

Nowadays, brute force quadratic time(O(N²)) solutions consisting of nested for loops just don’t cut it. The Sliding Window method is a great alternative to some brute force solutions. It typically of linear time(O(N)) complexity, and with space complexity of 0(1). If you are unfamiliar with time and space complexities check out Colton Kaiser’s articles on them here.

What is the sliding window?

How we go about creating a sliding window utilizes pointers. We would get an array, assign the first pointer to one index signifying where the window starts, and the second pointer to another index signifying where the window ends. Between those two points…

Image from Shutterstock

Why should we use it?

There are many different ways to approach solving problems. However usually, the most obvious ones aren’t the optimal solution. An example would be using nested loops. We call this the brute force method or the naive approach, and the reason these aren’t optimal solutions is that they are very slow. These solutions run at quadratic time(O(n²) Time complexity). The frequency counter pattern looks to give us a solution that is usually a lot faster(Typically at Linear Time; O(n) Time Complexity).

How does it work?

How the frequency pattern works is you would get a collection of data and store them within objects or maps…

Most programming languages typically follow one of two styles, Functional programming(software construction by creating pure functions) or Object-oriented programming(a class-based structure working primarily with objects). Go is a multi-paradigm programming language which means that it’s a language capable of doing both. But Go does not have classes so how could we do anything object-orient related? Go has Structs that function a lot like classes in other languages.

Creating a Struct

To initiate a struct we use the keyword type, the name you wish to call the struct, the keyword struct accompanied by some curly braces.

type Superhero struct {
firstName string

Photo by Max Duzij on Unsplash

Being able to work with a database is important. With SQLite we’re able to create new data tables, retrieve certain information from those tables, run queries to match certain data we want to retrieve, and much more. Here are the SQL commands that are most commonly used when working with a SQLlite database.

Creating a table

When creating a new table for a database, the command we use is “CREATE TABLE” followed by the name of the table and the attributes you want to include and their respective data types. …

In other programming languages like JavaScript, slices are a function that we call that returns a shallow copy of a portion of an array into a new array. In Go, they do very much the same thing, but the syntax is a bit different. It looks just like an array but with some key differences. First off, unlike arrays that are a fixed length, a slice’s length is dynamic so to declare a slice we just leave the area within square brackets empty. …

In every programming language, there are ordered series or arrangements of elements called arrays. But Go handles arrays differently compared to some other like JavaScript or Ruby. Let us take a look at Arrays, how they’re structured, and how to write them in Go! These examples were heavily influenced by Michael Van Sickle’s course posted on freecodecamp and the link for the resource will be at the bottom.


Go is a statically typed language elements within the array must be of the same data type. Arrays in Go must be of a fixed length meaning that if you initializing an…

Before going into how Go goes about handling its variables I want to do a brief explanation of the language and why someone would want to use the language in the first place. The Go programming language(also referred to as golang)is an open-source language that was developed at Google. The problem that Go tries to solve is that other languages at the time like C, Python, and Java had really slow compile times, and had complex type systems. Go is statically typed, has very fast compilation times, easy to read, and has garbage collection. Go is very unique with how…

Sean Dever

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