335 karma · joined January 31, 2020
For example, we couldn’t write a function that takes a slice of arbitrary type and determines whether the slice contains a given element. Instead, we had to write a function that takes some specific type, such as []int, or []string.
But this is dull, because the logic is exactly the same, whatever the type of the slice element. And now we can write that function just once, for all types. Let’s try."
In this article, I'll try to give a brief overview of where I think Go is the ideal choice, and where I think Rust is a better alternative. I'll also try to give a flavour of the essential nature of both languages (the Tao of Go and Rust, if you like)."
This completely revised and updated edition includes the four mini-books previously released as ‘Fundamentals’, ‘Data’, ‘Behaviour’, and ‘Control’, plus for the first time complete solutions (with tests) to all the coding challenges in the book.
Throughout the book we'll be working together to develop a fun and useful project in Go: an online bookstore called Happy Fun Books!
Each chapter introduces a new feature or concept, and sets you some goals to achieve, with complete, step-by-step explanations of how to solve them, and full code listings with accompanying tests.
There are 24 chapters, and 215 pages (depending on the screen size of your ebook reader).
By reading this book and working through all the challenges and exercises, you'll learn:
How to write tests in Go and how to develop projects test-first
How to manage data in Go using built-in types, user-defined struct types, and collections such as maps and slices
How to use objects to model problems in Go, and how to add behaviour to objects using methods
How to use pointers to write methods for objects, and how to use types and validation to make your Go packages a delight to use
How to build powerful, flexible programs using control structures like loops and functions
Even more importantly, you’ll learn a simple, fun, and effective way to approach software engineering projects in Go. Even though the material is beginner-friendly, you’ll be mastering intermediate and advanced techniques such as test-driven development (TDD) and learning to design modules, packages, and APIs. These are essential skills in any modern software engineering role.
"John Arundel is a software consultant, mentor, and author of the book “For the Love of Go”. We talk about his early fascination with computers, the role his mother played in planting these seeds, and the steps he took in his younger years to follow his passion. We then explore John’s indirect job path, having to settle for work as a technical writer out of college and stumbling into IT and system administration. But the major lesson that comes out of this is that these 'detours' actually served John's later work, developing parts of his expertise that would aid him in his writing and mentoring."
That's surprisingly close to what one of my contributors wrote in the piece:
> My take: Go for the code that has to ship tomorrow, Rust for the code that has to keep running untouched for the next five years.
A more useful way to think about it might be to ask whether such languages make vulnerabilities less likely, and for certain types of vulnerability (buffer overflows, for example), they absolutely do.
A commercial software project will also have a 'house style' which all contributors are required to follow. It's okay to withhold approval on this basis.
What I think you're saying, and I agree with it, is "don't withhold approval just because this isn't your style".