The language with two (or more) brains
Your brain is limited. I don't mean any offence, you understand: your brain is a wonderful instrument, and it's just as good as anyone else's, or perhaps slightly better. But even the smartest brain can still only do one thing at once, despite our constant and ineffectual attempts to multi-task with it...
...sorry, I was scrolling on my phone and lost the thread. But what if you could do two things at once, or even more? What would that feel like? What if you had two brains, for example? How would you organise them to work on independent tasks? And how would you stop them interfering with each other and making you very confused?
In this new tutorial series from my new book The Deeper Love of Go, we'll explore the world of concurrent programming, learn about some of the common pitfalls and how to avoid them, and find out why concurrency is a key feature of Go.
We'll learn about multitasking, time-sharing, scheduling, and why concurrency isn't the same thing as parallelism. It's an exciting journey, and it all starts with understanding goroutines.
How do you write good software in Go? And what makes good software, anyway?
We all know what bad software is: it’s awkward, poorly-documented, hard to use, badly-structured, and difficult to understand or maintain. It’s not enough to say “Just don’t do that.” We need practical guidance on what good software looks like, and how to build it.
The Power of Go: Tools is about software design through the medium of Go. Starting with small but useful command-line tools, you’ll learn how to tackle increasingly complex and demanding projects with a clean, efficient, test-driven design workflow.
Go is a kick-ass language for writing command-line tools, automation scripts, system utilities, or network services. We'll work on all of that, and this book will also give you a few clues about designing software that’s simple, modular, testable, and easy to maintain.
- Packages: design modular, reusable components with friendly and flexible APIs.
- CLIs: interact with users, handle input, flags, arguments, and errors.
- Files: read and write data using file handles, filesystems, permissions, JSON and YAML.
- Systems: wrangle commands, processes, I/O streams, pipelines, and interactive shells.
- Networking: understand HTTP, API clients, schemas, and data exchange.
If you're looking for some in-depth Go videos to watch, check out my YouTube channel: I've got dozens of hours of free stuff for you:
- Code Club — code reading and discussion of open-source libraries
- The Refactory — guiding students through improving their code
- Let's Code — I pair-program a game with my students' help
- Go University — the very best curated Go talks and deep dives
John Arundel
Grimshall, Boconnoc, Lostwithiel, Cornwall, PL22 0RX, United Kingdom
Powered by EmailOctopus