| 100 Go Mistakes and How to Avoid Them |
|
Author: Teiva Harsanyi Overall I'd say that this book makes the case that it is simply the programmer not reading the documentation, or just not understanding it, that is the problem. I can't say that there is a single Go mistake as listed here that I would put at the door of the Go language. I would also say that there aren't 100 mistakes included as a lot of them are simply about making use of what is available. The book started life from a successful blog post of just 10 mistakes - which I think is a more practical number to deal with. I can certainly believe that there are 10 common mistakes that programmers make in Go, but not 100. The first chapter is called Go: Simple to learn but hard to master. I'd take issue with this statement as I think Go is a pussycat compared to languages like C++, Rust or even C. It is a small language that is easy to master - that doesn't mean you won't make mistakes. The first chapter dealing with "proper" mistakes is about code and project organization and again I disagree with emphasis here. The first mistake is using a declaration then using a declarative assignment. That is: myvar:=123 is equivalent to var myvar=123 This shorthand has long been known as a potential problem in Go and in this first mistake it is used to write a program that shadows a variable declared in an outer block. The suggested solution is to use a temporary variable with a different name and then assign it to the "global" before the block ends. This is silly as the problem is that the inner variable was declared as a new variable when in fact you wanted to use the global. Simply changing the assigment to the usual = rather than := solves the problem. At a few points I thought that a mistake was attributed to something that wasn't the real cause of the problem or that it could have been better avoided by understanding what is going on in a wider context. |
Fundamentals of Database Management Systems
Author: Dr. Mark L. Gillenson This book is aimed at people taking a one-semester course in database management as part of their larger information systems management course. As suc [ ... ] |
Killer ChatGPT Prompts (Wiley) Author: Guy Hart-Davis This book aims to get optimal answers to your questions from ChatGPT, how does it fare? |
| More Reviews |

