The original article at www.gophersre.com: here

TLDR

Preamble

Hey, if you don’t want to listen to my meandering (and I can meander with the best of them), just skip towards the bottom.

Does anyone like HTML for Apps?


Note: Originally published at gophersre.com (easier to read there)

Flatbuffers are a Google message format in the same vein as Protocol Buffers or JSON. They were designed for game programmers in C++ who want to avoid heap allocations at all costs.

It isn’t a new tech, but I started seeing articles recently saying people should use them. I was truly skeptical about this as all the example code for Go looked painful.

I recently had a very niche use case where I have a proxy service that needs to inspect incoming messages before passing them along. …


What the worst projects say

Have you heard any of these:

When I talk to people about their projects or am deciding on which projects my project will depend on, I often look at testing and documentation methodologies.

The projects that I come across without adequate testing and documentation are the ones I find problematic over time to deal with. …


Sooner or later every Go programmer will want to extract an object from another object such as Context or utilize an object that can be set to nil throughout the call stack. However, this can lead to ugly code that looks like:

func someFunc(obj *MyObj) { 
if obj != nil {
DoThis()
}
otherFunc(obj)
}
func otherFunc(obj *MyObj)
{
if obj != nil {
DoThis()
}
...
}

I this case, if our obj != nil, we want to perform an action.

A use case I recently ran into was the extraction of a *Tracer object from a Context in…


Note: This is a continuation of this article

Type safety and the compiler to the rescue

One of the first things we noticed using Go was that once a program compiled, it tended to work.

This was not the experience that we had in Python. Small programs usually took a lot of runs before we got the bugs out. But Go usually just worked.

Now of course, larger programs are different, Go isn’t magic. And Go does have a few runtime problems, namely nil pointer dereferences, non-initialized channels and assigning to a nil map. …


Before we begin

This article will be about why I switched from Python to Go. This is from my experiences doing development in both over many years.

Like many articles of this type, some people might feel that their choices are being offended. That’s really not the spirit of this article. This is more of a historical perspective on my part to show why I, and later the group I worked for, moved from Python to Go.

If you are a Python programmer interested in Go, this article is written for you. Switching was not an easy task, it required abandoning years of…

John Doak

Principal SWE@Microsoft, Photographer, World Traveller, Nature Enthusiast

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