Reading and Writing Different Files in Go

Reading and writing files is an important feature of your program. Not all data is stored in the same memory space as your program, and sometimes you will need to share data with other programs or view it later with a different program. Storing your data in a file is a good way to achieve these goals. Today, we will look at how you can read from and write to commonly used file types.

Working in a Team

I spend a lot of time developing solo, working on my personal projects. However, I have worked in big project teams in the past, and have had some experience working with other developers and non-developers. Here are some tips that I would like to share with you. Please understand that this is a beginner’s viewpoint and can be subjective. If there are more tips that you would like to share, please comment below!

Imposter Syndrome

Let’s take a slight detour from the usual programming guides. Today, I want to address the bane of all developers. The one that plagues juniors and seniors alike. func (s *self) ImposterSyndrome() { for { doubt() fear() panic() } } s.ImposterSyndrome() “Maybe I’m not smart enough to be a developer.” “He’s so much better at this than I am.” “How come she gets it and I don’t, when we started the same?

Interfaces in Go

If you are going to use Go extensively, you need to understand how to use interfaces. Interfaces aren’t specifically a Go thing, but Go is one of the more extensive users of the feature. Interfaces allow you to write reusable code. What are interfaces? Interfaces are a way to group objects into their common behaviors. An interface is defined by its name and the methods the objects need to define. Any object that has those methods defined “implements” the interface.

Using Goroutines Is Slower

Ah, goroutines. One of the most defining features of the Go programming language. Once you understand the syntax of goroutines and the theory behind concurrency, you feel as if you just gained a superpower. A hammer, if you will. We get so excited to make everything concurrent. I am definitely guilty. I mean, why not, right? Concurrency solves the issue of blocking code, so making everything as concurrent as possible will speed things up, right?

Trees in Go

Welcome back to Introduction to Data Structures in Go! In this post, we will be looking at trees. So far, we have looked at linear data structures. There was one beginning node and one end node. Data traveled in one direction: either left to right or right to left. Trees are nonlinear, which adds a layer of complexity. Trees are widely used in the programming world for many different purposes, so it is a good idea to get a firm grasp on the topic.

Benchmarking Go Code

If you have been programming in Go for some time, you probably really like the tooling that comes with it. The language itself is packed to the brim with useful tooling such as go test, go fmt, go build, etc. We have gone over testing before. Today, we will be looking at how we can benchmark our Go code. Why you should run benchmarks Ever wondered how fast and efficient your code runs?

Debugging Go Code With Delve

“Genius is 1% talent and 99% hard work.” “e = mc^2” – Albert Einstein In the field of software development, the quotes can be changed slightly: “Software development is 1% programming and 99% debugging.” “errors = more code ^ 2” – Some senior developer, probably Debugging is something all developers must go through, and it does not care about your expertise. It’s a frustrating process. To err is human, and errors will absolutely creep into your program.

Writing Tests in Go

In today’s post, we will be looking into how to write tests in Go. Test-driven development, also known as TDD, is a paradigm in which developers are encouraged to test their code as they go. What is a test and why should I care? A test is a piece of code written to verify that your code behaves as it should. At first, this may sound quite tedious. Meh. I know my code through and through.

Queues in Go

Welcome back to Introduction to Data Structures in Go! In this post, we will be looking at queues. We hear the term “queue” thrown around a lot in real life. The queue for the movie tickets is long. Man, it’s taking forever to queue up for this League match. Queues are a familiar concept for most of us. Queues as data structures Queues are a special list, just like stacks. Unlike stacks, however, queues are known for being FIFO data structures.