Jon Calhoun

Jon Calhoun @joncalhoun

About: I get to teach people how to program with Go. How cool is that? 😁

Joined:
Feb 3, 2017

Jon Calhoun
articles - 26 total

Crash Course on Go Interfaces

Interfaces in Go are going to be a foreign concept to many developers. For many, they will be coming from dynamic languages where interfaces aren't necessary, and for the devs coming from languages like Java they will have to drastically adjust their mindset to take advantage of Go's unique approach to interfaces. In this article we start diving into how those interfaces work.

Learn More 15 0Jan 21 '21

Concurrency Patterns in Go: sync.WaitGroup

Learn how to use sync.WaitGroup in concurrent Go code to wait for a group of goroutines to finish before proceeding with the rest of your code (or terminating the program if in main).

Learn More 10 0Jan 11 '21

Testing API Libraries

Nearly all apps need to talk other apps via API. In many cases we end up writing those API libraries on our own, which means we need to come up with a reliable way to test that code. In this article we explore techniques and advice that make it easier to test and maintain API client libraries written in Go.

Learn More 8 0Jul 22 '20

More Effective DDD in Go with Interface Test Suites

When using domain driven design in Go, there are a few techniques that can be paired with DDD for a better overall experience. One of those is interface test suites - tests designed to run against any implementation of an interface. In this article we explore what interface test suites are, how to utilize them, and why they pair so well with DDD.

Learn More 22 0Feb 19 '20

Moving Towards Domain Driven Design in Go

Domain driven design sounds great in theory, but how is it applied in Go? In this article we explore some code as it slowly evolves into DDD, learning how and why each decision is made along the way and what benefits it will provide us in the future. We then discuss the pros and cons of starting with a more domain-focuses design.

Learn More 20 0Feb 18 '20

Using MVC to Structure Go Web Applications

MVC is a well-known way to structure web applications, but it is often shunned in Go. In this article we explore how MVC can be effectively implement in Go as well as how to avoid all of the issues that many people associate with MVC.

Learn More 42 0Oct 22 '19

Flat Application Structure in Go

Rather than spending time trying to figure out how to break code into packages, an app with a flat structure would just place all of the go files in a single package. This sounds kinda crazy, but can actually be a great facilitator of learning and letting code evolve into a better final state.

Learn More 23 0Oct 22 '19

Why Can't We Settle on a Single Web App Structure in Go?

Getting started in Go can be hard. The language itself is pretty easy to pick up, but figuring out how to structure your application can be overwhelming early on. At least it was a big time sink for me coming from a Ruby on Rails background where all of those early decisions were made for me. As I progressed I kept wondering why I had to make all of these decisions myself. In this article we explore why that is the case.

Learn More 46 2Oct 22 '19

How do you get the most out of tutorials, courses, and other coding resources?

With all of these development tutorials and courses on the internet, how do we get the most out of them? What tips and tricks are you using to maximize how much content you retain?

Learn More 42 10Jun 5 '19

Getting the most out of coding courses & tutorials

With all of these development tutorials and courses on the internet, how do we make sure we are retaining what we read? In this post I discuss different techniques that help improve how fast you learn, how much info is retained, and even ways to expand beyond what the tutorial is teaching.

Learn More 17 0Jun 5 '19

TDD is Not for Me

Test driven development is thought of as a practice every developer should adhere to, yet many of us privately struggle to be productive using TDD. In this article we explore some of the reasons why TDD isn't always a great choice and can hinder your productivity

Learn More 131 26Mar 15 '19

Testing is Not for Beginners

Everyone keeps saying you should be testing, but are they right? In this article we discuss the downsides to trying to learn testing too early and how it can negatively affect your ability to learn to code.

Learn More 61 6Mar 13 '19

When nil Isn't Equal to nil

It is easy to get confused by when and why different variants of nil will be equal and when they won't be in Go. In this article we explore why this happens so that you know what to expect when writing your code.

Learn More 22 0Sep 24 '18

Web Development with Go - 2.2 - Explaining our web application in detail (screencast sample)

Third screencast sample from my Go Web Development course (usegolang.com).

Learn More 14 1Jun 4 '18

Web Development with Go - 2.1 - A Basic Web Application (screencast sample)

Second screencast sample from my Go Web Development course (usegolang.com).

Learn More 41 0Jun 4 '18

Web Development with Go - 2.0 - Creating a code dir & git repo (screencast sample)

First screencast sample from my Go Web Development course (usegolang.com).

Learn More 13 0Jun 4 '18

What would you do differently or the same if you had to learn to be a developer all over?

I posted these questions on Twitter, but I want to get responses from a wider audience. When learnin...

Learn More 20 4May 31 '18

Building Gophercises

We developers have a tendency to overcomplicate software to our dismay. In this post I discuss how I embraced simplicity while building the Gophercises website. (Gophercises is a free Go coding course I created)

Learn More 67 4May 30 '18

Using the Service Object Pattern in Go

Developing a web application without separating the logic used to parse an incoming request from the actual application logic can be painful. It is hard to test your card, dependencies aren't clear, and the code can become a mess. Learn how to apply the service object pattern to your Go code in order to properly isolate these concerns, making it easier to test, maintain, and read your code.

Learn More 59 0May 6 '18

Using named return variables to capture panics in Go

Sometimes you can't help but call a function that might panic. Rather than letting it blow up your code, learn how to use a deferred function and named return variables in order to capture the result as a standard Go error.

Learn More 23 3Mar 26 '18

Securing Cookies in Go

Learn how to properly secure cookies from tampering, theft, XSS, CSRF, and more in Go.

Learn More 18 0Mar 9 '18

When Should I Use One Liner if...else Statements in Go?

After using Go for a few weeks, chances are you are going to run across a single-line if...else statement. Most often, you will see this with an err (eg if err := doStuff(); err != nil { ... }). This article discusses the situations where a one-liner is appropriate, and ones where it isn't a great fit.

Learn More 20 3Mar 6 '18

Using functional options instead of method chaining in Go

Learn to use functional options instead of method chaining to write cleaner and less bug prone code in Go.

Learn More 18 2Aug 10 '17

Subtle issues with ORMs, and how to avoid them

Learn about how ORMs can lead to problematic code bases and some steps that can be used to avoid these issues.

Learn More 15 4Jul 31 '17

What is SQL injection and how do I avoid it in Go?

Learn about how SQL injection can destroy data and how to avoid it when interacting with an SQL database in Go.

Learn More 15 7May 19 '17

Using code generation to survive without generics in Go

Learn how to use code generation to create type-safe code (like a Queue or LinkedList) in Go without having to rewrite the same thing over and over again.

Learn More 16 9May 10 '17