Are you a Go black belt?

Are you a Go black belt?

zorro.png

Legend tells of a legendary warrior whose kung fu skills were the stuff of legend.
“Kung Fu Panda”

Here in the Go department at the Bitfield Institute of Technology, we have students of all levels of ability, from complete beginners to experienced code warriors. It’s helpful to have some way to judge roughly where you are on that journey, what you’ve mastered so far, and what you should be aiming to learn to take your skills to the next level.

The same applies in the martial arts, and most people are familiar with the coloured-belt system of grades, from white belt (beginner) to black belt (competent), and sometimes beyond. So how would that work in Go? What’s the Go equivalent of a black belt in karate or judo, for example?

You might like to measure your own skills against the following categories, to get an idea of where you are and where you’re going. If you’re studying Go with me, you’ll progress through these ranks at a speed limited only by the time and effort you’re able to put in, just as you would in the martial arts dojo.

For each belt level, I describe what I’d expect a typical developer at that level to know about Go, what they should be able to do with Go, and what they’d be able to explain to someone else (this is quite a reliable way to find out what you really understand, and what you don’t).

White belt

You’re new to Go, and perhaps to programming in general, although you may have some experience with other languages. You might have read a few articles or blog posts about Go, and be aware of some of its features, or maybe not. If you feel dismayed by how much there is to learn, don’t be! If you’re willing to put in regular time and effort, you’ll get to a decent level of skill with Go more quickly than you think. The journey starts here!

Recommended reading: For the Love of Go

Yellow belt

The first rung on the ladder, achievable with perhaps a couple of weeks of focused study.

What you know

  • You understand the basic Go concepts of packages, functions, parameters, return values, variables, maps, and slices, and roughly how they work.
  • You’re familiar with fundamental flow control techniques like if-else and loops (including range).
  • You’re aware of and have used some basic built-in types, like int and string, and the most commonly-used standard library packages (especially fmt).

What you can do

  • You can write simple tests, including multiple cases and error handling, and can develop small, simple programs test-first.
  • You can read and mostly understand simple Go programs, albeit with some time and effort, and perhaps many questions for a teacher or more experienced developer.

Qualifying

To qualify for a yellow belt, you’ll need to complete a simple project from scratch, probably with some assistance, demonstrating all the skills required at this level.

Example project: shellspy

Recommended reading: For the Love of Go

Green belt

At this level, you’re no longer a beginner, but you’re not yet a seasoned Gopher. You’re probably in a good position to be hired as a junior Go developer, especially if you can be paired with someone more experienced to help you, though some firms hiring for junior roles may perhaps need you to be at the next belt level.

You’ll have built at least a couple of simple projects from scratch, test-first, to a working prototype state. You’ll be capable of completing simple whiteboard coding tests and maybe a small take-home project, and you’ll be able to explain your design and coding decisions to an interviewer, and talk about how you managed to solve certain issues (or didn’t!)

Reaching this level might take a few weeks from yellow belt, depending how much time you can put in. If you’re able to study full-time, every day, you’ll get there quicker, but if you can only spare half an hour between work and family, it’ll take slightly longer, but don’t worry: you will make it.

This will probably be one of the hardest stages of the learning journey, because you’re absorbing lots of new concepts, but still struggling to fit them together in a coherent way. Keep practicing as much as you can, and it will come.

What you know

  • You’re familiar, if not expert, with most aspects of Go syntax and behaviour, especially data structures and types, including pointers and methods, and more advanced flow control statements such as switch and defer.

What you can do

  • You can write clear and idiomatic code to solve simple problems.

  • You can write clear, helpful, and task-oriented documentation for users of your tools, and consumers of your packages, including executable examples.

  • You can use the Go tools to build and test projects (including test scripts).

  • You can write tests which require dependency injection, simple fakes or stubs, or the adapter pattern.

  • You can implement features and bug fixes, though it’ll be much easier with help from someone more experienced.

  • You can navigate, read, follow, and to some extent explain relatively simple and straightforward Go projects.

What you can explain

  • You can introduce beginners to basic Go concepts, maybe up to yellow-belt level, though your knowledge of more advanced things may not be quite solid enough to really explain them in detail. (However, trying to explain them to someone who doesn’t know is a great way to find the gaps in your own understanding.)

Example project: habit

Recommended reading: The Power of Go: Tools

Test yourself: So you’re ready for green belt?

Blue belt

At this level you’re a pretty competent Gopher, capable of taking on most tasks that a full-time professional Go dev would be asked to handle, and for more difficult jobs you’ll be a very valuable partner to someone more experienced. You might reach this level after perhaps 3-6 months of focused study and work following your green belt grading, ideally writing as many different types of Go program as you can. You will be an easy hire for any Go developer role, slotting straight into a team and being able to make productive contributions right from your first day.

You’ll have plenty of experience of building Go projects from scratch, including API servers, clients, and database integration, to a releasable state, and you’ll be well on the way to developing good taste in API and package design (because you’ll have done it wrong enough times to know what not to do).

What you know

  • You have a confident knowledge of almost every detail of the Go syntax and spec, and the most-used standard library packages.

  • You’re comfortable with most common uses of the Go tools, including benchmarking, cross-compilation, and simple profiling.

  • You have a good understanding of concurrency patterns and issues, including familiarity, if not expertise, with goroutines, channels, select, waitgroups, and mutexes. You’ll have built at least one non-trivial concurrent program.

  • You understand the meaning and basic use of interfaces, especially io.Reader/Writer and any, including type switches and type assertions. You can build simple interfaces to allow injection of fakes in tests, for example.

  • You’re familiar with standard patterns and when to use them, as well as common mistakes and how to avoid them.

What you can do

  • You can test the trickiest functions, including network and database clients and HTTP servers or clients.

  • You can undertake well-specified features and bug fixes independently, or with minimal assistance.

  • You are reasonably confident in designing and structuring projects with a few subpackages; a library with an accompanying CLI tool, for example, or an API server with a matching client library.

What you can explain

  • You can explain any aspect of the Go spec.

  • You can read and explain the key details of fairly sophisticated and complex Go code, and could teach complete beginners to at least green-belt level.

  • You can answer questions about the syntax, purpose, and use of most things in Go, including standard library packages such net/http and database/sql. You may not know all the details of how things are implemented in Go, but you know how to use them.

Example project: gmachine

Recommended reading: The Power of Go: Tests

Brown belt

This is a level of Go expertise which some people probably won’t ever reach, and they may not need to, even if they’re a full-time programmer. It goes beyond “competent Go developer”, representing someone who has both wide and deep knowledge of Go and software engineering. At this level, you can probably lead a small team, setting standards and making wise choices about project structure and development workflow. You are the sort of person whom people come to with obscure questions about Go, mysterious compiler messages, or problems that defeat even fairly experienced coders.

You have extensive experience of Go development, including working on substantial projects at a contributor level, and originating many smaller projects from scratch, including reliable concurrent programs, and at least one project to a mature state. You most likely have at least a couple of years of full-time commercial Go development experience, if not more, as well as the independent study and practice that brings deeper technical knowledge. You’ve probably also created at least one significant open-source project in Go, and contributed to many more, including perhaps Go itself.

You’re a slam-dunk hire for any mid-level Go role, or team lead on even a moderate-sized team, and you’re probably not far off stepping up to a senior developer or architect position, if you can demonstrate enough solid commercial experience. It’s likely that you’ve been working full-time with Go for at least two or three years, though if you have previous experience with other programming languages, you may well get here more quickly.

What you know

  • You not only have complete and fluent knowledge of all Go concepts, you also have a comprehensive and up-to-date technical knowledge of Go internals, including some understanding of the runtime, compiler, assembler, memory model, and so on.

  • You have a good working knowledge of computer science and computer systems engineering concepts, such as algorithmic complexity, programming language theory, compiler design, and related topics.

What you can do

  • You can design and build large, complicated Go projects, integrating with many different kinds of external dependencies and services.

  • You’re quite capable of complex refactorings in multi-package projects, and adding worthwhile tests to existing, untested code.

  • You can confidently use and apply all the standard library packages in real-world projects, as well as many important third-party packages.

  • You can use the debugging and profiling tools well, and you can identify and optimise performance-critical code. You can find and fix the most difficult and obscure bugs, including in complex distributed or real-time systems.

What you can explain

  • You can read, explain, comment on, and most likely improve on the most sophisticated Go code, and teach beginners to perhaps blue-belt level.

Example project: procrastiproxy

Recommended reading: Know Go: Generics

Black belt

At this level, it’s not really about your technical Go knowledge (a brown belt should already know pretty much everything there is to know), it’s more about how you can apply it. You have extensive experience of software engineering in Go, including substantial projects built from scratch to a mature level, and you’re capable of steering any major commercial project from its inception to a successful conclusion. You’re also ready to step in to rescue a failing or struggling project, identify what’s wrong, work out how to fix it, and liaise with management and multiple development teams to roll out your improved practices and techniques.

You will have had many years of software engineering experience, the majority of them focused on Go, and you will probably be either a senior developer, platform architect, head of development, or an equivalent role in a large company, or you will be a seasoned consultant who is brought in to provide expert assistance on the most demanding projects. Alternatively, you may be the CTO or engineering leader of a small to medium-size firm.

Your taste in Go is excellent, and you understand the importance of aesthetics in software design. If it looks elegant, it is elegant. But the real world is complicated and messy, and so are the problems we solve, so a master of Go knows how to eliminate the irrelevant and boil problem domains down to their essential components, in a way that makes elegant and extensible designs flow naturally.

What you know

  • You have complete technical mastery of Go, naturally, and more besides. You understand the operating system kernel and the hardware, the networking protocols, distributed systems, Unix and perhaps other platforms, to a deep level, and you can apply that knowledge to building working systems.

  • You understand project planning, user testing, development, CI/CD, release workflows, and the business side of software development. You can communicate fluently with management and finance folks, and you’re ideally placed to be the bridge between the technical and non-technical sides of the business.

What you can do

  • You’re more than capable of leading a large team, or multiple small teams of Go developers. You have excellent people skills, and you understand that everyone is different and needs your individual understanding, support, and help.

  • You can solve the hardest engineering problems, but you can also solve the kind of problems that involve getting multiple teams and departments to work together, across cultural or other boundaries, fixing seemingly impossible organizational dysfunctions, and hiring or retaining the finest and most diverse engineering and technical leadership talent.

  • You’re well-placed to set standards, build quality processes, and establish best practices for software development and operations. You can, and probably should, write a book on such things, or provide professional training and development materials to people who need them.

What you can explain

  • You don’t just know your subject inside out, you have the knack of putting yourself into a beginner’s mindset, remembering what it was like not to know what you know, and empathising with your students when they find things challenging.

  • You have experience of teaching Go and software engineering from beginner level to at least brown belt, and you can explain tricky concepts clearly and helpfully, as well as write tutorials, exercises, and technical material for students.

  • You have unlimited resources of patience, encouragement, and support for complete beginners, yet you’re also sensitive, diplomatic, and tactful enough to guide people who may have a great deal of experience, but still need your help. People can become very invested in seeing themselves as experts, and sometimes this makes it hard to learn new things, because it’s not easy to swallow your pride and be a beginner again. As a Go teacher and mentor, you know just the right thing to say to each person to keep them enthused and motivated about their learning.

Example project: script

Recommended reading: Explore Go: Cryptography

Beyond belts

Having said all that, belts don’t matter in the martial arts, to those who understand what it’s all really about, and they don’t matter in Go either. They are useful as a tool on your learning path, but that’s all. When you first start learning something, you really have no way of measuring the extent of your knowledge, because you don’t know what you don’t know. We’re all familiar with that effect.

At that stage, then, it’s helpful to have a syllabus, if you like, which you can use to measure your progress, identify what you need to learn next, and understand where your skill level fits in to the general population. This is my attempt to provide that, but it’s a very personal viewpoint, and there’s plenty of room for disagreement about what Gophers at different levels should and shouldn’t know.

You should see these ‘belt levels’ as essentially arbitrary; not things to be achieved in themselves, but signposts along the way, if you like. When you get good, you will know how good you are, and what you still need to learn, and from that point on, yours will be the only worthwhile opinion on that subject. The belt system will help you get to that point, that’s all.

DANIEL: Hey, what kind of belt do you have?
MR MIYAGI: Canvas. JC Penny. Three ninety-eight. You like?
“The Karate Kid”

As a teacher, I place a very strong emphasis on fundamentals. When students of any level of ability ask me what they should be working on to improve, my answer is always “Fundamentals!” In a very real sense, mastery of any craft is directly proportional to your understanding of the fundamentals, and at each level, we learn to re-interpret that basic knowledge in a new and deeper way.

Let us leave the last word to the late, great rock drummer Neil Peart, who after two decades at the top of the music business touring with Rush, made the brave decision to take drum lessons and completely re-invent his technique from the ground up.

He said:

What is a master but a master student?

Go vs Python

Go vs Python

Writing slower Go programs

Writing slower Go programs

0