Thank you for this fantastic resource. I've been meaning to learn Go for a while, but have a lot of difficulty staying focused on tutorials with big blocks of text. Your concise bullet format is really easy to follow, and would be especially useful for anyone who doesn't speak English as their first language.
Also really respect that you clearly did this out of passion, so I'll say this to everyone on your behalf: support the author by purchasing a digital copy!
Man I been looking at diving into Go for a while now, time to go in headfirst. Really appreciate your contribution and I feel the exact same way about wanting to give back to the community, one day I'll have something of value to offer!
Maybe you can begin by blog posts ? It is a good exercice to dive deep into a subject and make sure you understand it. Do not hesitate to contact me if you want support in the process
Hi, Maximilien. I really like the structure of the books. It starts with "what we will learn" and ends with "test yourself" and key takeaways. The structure can help the reader to really conscious in understanding the learning goals and validating the understanding.
I also always want to write a programming language book or some other technical topic book in general, which the writing process will I use as learning process for myself. But I always wonder in deciding the topic to cover. How do you decide the topics to cover? Do you start from following existing books or online documentation topic sequences? Or just write whatever topic you are interested first and structure the content afterward?
Thanks for your comment ! If you want to do it, just pick a language and start to write.
Writing is not easy but it becomes easier if you transform it into a habit.
In my experience I forced myself to write regularly like every day of the week. I usually worked one hour approximately by session.
By doing so you will see that you will achieve a lot.
Do not force youtself to write for one entire day then do nothing for a week.
Concerning the topics to cover I will recommand using a mind map to build the table of content. This is interesting because you can drag and drop sections easilly.
I would suggest first to define your targeted audience. Having this audience you can begin building the plan.
My approach was to teach notions progressively. Sometime I needed to rework the sections order. Use an editor that allow you to do that easilly like Lyx (love it).
Students generally love rituals and adding some introduction ritual/section and conclusion section is a plus.
Hope those recommendations will help you :)
Writing something is really a great way to make sure you understand something !
In Chapter 6, Section 3 (Introduction) you say, "In a previous chapter, we covered decimal and binary notation." but those topics aren't covered until Chapter 7 :)
I really like that you go in detail of common and important standard library functions and hit come important things like database drivers and JSON. 700 pages is a nice big programming book and it looks like you're not skimping on details. Great job and good work!
Can you help me understand this code on interfaces? If you were calling (CartStore.GetById()) where does (*cart.Cart) come from? I don't see any logical connection between these two.
type Cart interface {
GetById(ID string) (*cart.Cart, error)
Put(cart *cart.Cart) (*cart.Cart, error)
}
// A type that implements the interface :
type CartStore struct{}
func (c *CartStore) GetById(ID string) (*cart.Cart, error) {
// implement me
}
func (c *CartStore) Put(cart *cart.Cart) (\*cart.Cart, error){
// implement me
}
I think that there is a mistake in the name of the interface type.
It should not be `Cart` but something else. Like `CartStorage`.
A type that implement this CartStorage interface can be named `MySQLCartStorage` or `DynamoDBCartStorage`. Each database engine responsible for the storage will have a different implementation.
The interface is here to define a contract, a set of behaviors that you should implement.
Let me just clarify, sorry i'm from python, so not very familiar but this feels like a "circular reference". You're implementing a struct CartStore which has methods GetById, and Put. Because interfaces (or contracts) are implicit then it's automatically considered a Cart.
What I don't understand is the return types of these functions, a pointer to a cart's cart member? or an error.
So the name Cart is an interface, the function/method signatures are indicating that a Cart is being returned but being explicit about the package the interface belongs to with cart.Cart. It's made more confusing since the name cart (lower-c) is being used for both a member variable and the package name in the signature of Put, and it looks like the package name doesn't show up on an explicit line in that chapter to help clarify it.
One feedback: I skimmed through the Context chapter and noticed that you made the common mistake.
In the code snippet provided at https://www.practical-go-lessons.com/chap-37-context#the-ser..., you made the channel unbuffered. The doWork goroutine would write to the channel and the "main" goroutine would read from it. But since the "main" goroutine could exit early because of context cancellation, they could get into the case of no one on the reading end any more, causing the doWork goroutine to be blocked forever (the writing to the channel is blocked when there's no one to read it).
I think this is very well structured. I really like the "Test yourself" section. As a person who finds small post-reading assignments enjoyable and motivating, my only suggestion would be to add a small assignment that employs the learnings. Actually coding what one just learned is arguably a good way to reinforce the learnings and raising further questions/doubts. E.g. for your Application Configuration chapter, an example assignment could be:
Create a command line application that accepts users inputs as below:
a. Mandatory "-firstName" flag to accept first name
b. Mandatory "-lastName" flag to accept last name
c. Optional "-middleName" flag to accept middle name
d. Mandatory "-age" flag to accept age - only integers between 0 and 200 should be accepted
e. Optional "-party" flag to accept political party following - only valid values are "D", "R" and "I"
d. Optional "-userId" flag to specify user id - if HOME environment variable is set, extract user id from home directory path
This is great,well done! I was thinking of picking Go at some point this year, need not to forget to buy the book.
May I ask what did you for the website,looks pretty neat?
Great book! (and this from someone who does not like Go :)). After reading a bit I was almost ready to jump in again and then I remembered errors and the associate repeating code and I got back to Python.
I have a friend who is constantly trying to drag me though the fence so maybe one day.
You may want to try quasar (https://quasar.dev/) for your VueJS sites - it is excellent.
Thank you for your work. I absolutely love the book.
You might add links to buy digital copy at the very top of the page. Currently, I've found the link on 3rd attempt)
Also, why not sell on Gumroad (https://gumroad.com)? It is convenient.
Good luck!
On another note, you might want to consider converting the online copy of the book to MkDocs (using the Material theme), so that it's easier to read, navigate and search.
I like the current design, it is really clean and pleasant to read.
I don't like Material Design, kind of makes everything look massive taking up too much space as if my desktop is a phone screen. for ex: http://angular-material.fusetheme.com/ui/forms
MkDocs isn't a "format" as such. It requires you to write Markdown and then configure the mkdocs.yml file to define the website's properties, such as the navigational structure.
This looks great! It looks really well thought out and practical. Congrats on the release. Kudos and thanks for making it freely available as well. Cheers.
I can't thank you enough! I wanted to learn Go and wanted something like this. I really like the chapter structure, it really easy to follow and progress.
I'm writing the book with Lyx. Lyx documents are converted to LaTeX docs, then converted to HTML with pandoc.
Then I have a homemade Go script that generates the VueJs components (one per chapter).
This question is asked a lot so I will write something about the system because it can help other writers.
I just scrolled through the chapter that looked most promising to me in the table of contents (Chapter 36: Profiling) and I have to say I love it!
On that one hand the basic steps are there like how to download a specific zip file, but at the same time it goes deep into the different types of profiling and how to use the mandatory tools.
Thanks for your support arendtio !
I am happy that you liked this chapter, it took me a lot to write, because I never used pprof before. But it's a great tool.
Whenever I encounter any book on go , the first thing I do is to read the installation page . This is the best I’ve seen of any book . You made the whole “PATH” thing that drives new go users mad and gave a thorough reason of why it’s needed .
Excellent job! Maybe you are already thinking about it, but... You can add a Search Bar and Go version & language selection for the documentation. (i.e. see (bottom left): https://docs.godotengine.org/en/stable/)
Also I just published this on /r/golang if you do not mind. :)
Thank you for those suggestions. Adding a search bar is already in my todo list. I will probably use Algolia.
Thank you for posting this on reddit ! I tried to do it but I made a mistake in the title, so I deleted the post and posted again (I never posted on reddit before). Now it seems that my second post is not really visible.
This looks great! I absolutely love that it assumes no knowledge of anything, including how the computer works. This is how all educational material should be written.
I think that most knowledge gaps we all have are caused by a teacher/book making assumptions about what we already know.
Thank you for the feedback. I tried to make it accessible to new programmers. I hope it will be used by people how wants to start their programmer's journey.
Being a self-taught programmer, I always suffered from not knowing some very basic notions. I learned a lot in the process of writing those chapters.
"This site is blocked due to a security threat that was discovered by the Cisco Umbrella security researchers."
Category: Malware
That is the warning I'm getting on this link at work. Of course I don't think you are trying to malware people, but might want to look into that on why people might not be able to access your site.
Hey there, this is really inspiring. I did something similar to what you described (writing on weekends while working) except I wrote a novel, not a tech book.
I have some feedback, 5.1 Garbage collection, you write "By chance, Go has a garbage collector." Was this really by chance? I don't know think so, it was by design! You even suggest this with your paragraph before explaining what GC is. Consider changing the word "chance" to something like "design" or another word that reflects the concerted choice by the Go authors.
If you find this helpful, let me know and I'd be happy to continue giving you any similar feedback.
Obviously I haven't read much yet but skimming through it for 5 minutes I am impressed with what I see. Great work!
One thing I feel is missing, a PDF preview of a few pages so I can see how it looks in the digital edition. Not a huge deal so don't stress about it but I always like to preview ebooks for some reason. I may be alone here tho :)
Really though great work. I am especially impressed at the effort you put into getting a dev environment "up and running" on Windows, Linux and macOS.
Sounds great to me! Can't go wrong with a nice looking preview ;)
Also I forgot to say I really appreciate you giving this away for free online. It is clear you put a tremendous amount of time and effort into making this.
Great work! I headed to the context chapter and learned something I was not certain. But regarding the linked list (https://www.practical-go-lessons.com/chap-37-context#linked-...), since a context can be parent of multiple contexts, I feel it's more like a tree structure.
Learned something useful right away in the cheatsheet. Use table tests all the time, but never thought of the param struct for multiple function params.
The table test model provided in this chapter is an adaptation of the one automatically generated by Goland, i find it really cool to use !
If you have the IDE right click > Genenerate > Table test !
I plan to add more content to the cheatsheet in the future , so stay tuned :)
How'd you build the Web site — a package of some sort, or did you roll your own CSS? I've been working on a law-related book that I plan to post; I like the look of your site.
(I suppose it's too much to hope for that you created this with Emacs and org-mode — which is what I'm writing my book in — together with a nifty CSS package ....)
This is fantastic. I just learned the basics of Go by building an SDK for a friend’s REST API. I’ll tell you what, you want to learn a language, build a client SDK. You’ll hit so many crazy issues, you’ll be forced to learn how things work.
That said, I’ve got a long ways to go, and I’ve already plowed through six chapters of the book. Nice work!
Hello, this is a great resource! I noticed a typo on Chapter 8, 7.1, and thought I would report it: "If you are used to programming the first two develop the first two actions are common."
I think "the first two develop" was meant to be deleted here.
Great work. I am learning golang right now. The art/pics look amazing and the samples and the explanations are on point. Thank you for your work! I'm sure it will go a long way I'll made sure I tweet about it.
Please, consider reviewing this line, from chapter 5, "I use Goland, which IntelliJ develops".
GoLand is developed by JetBrains. IntelliJ IDEA is their Java IDE : )
I appreciate chapter 40 being included, a quick summary of go/programming recommendations. Also the illustration on the landing page caught my eye, good choice.
Many thanks! When I began writing Go code I found a lot of "Go idioms" on blog posts, it was hard to remember all of them.
By the way, "Effective Go" (https://golang.org/doc/effective_go) is also a great summary of good practices.
The book looks very interesting! In the section about logging, Logrus is unfortunately in maintenance mode now. We've used it at my place, now we have switched to Zap.
I applaud the effort. Very impressive work. I appreciate the free access to this, but will be buying, if / when I have time to work through some of the lessons :)
looking good! I liked the fact that you took a holistic approach where you don't ONLY teach go but also things like anatomy of a computer, json/xml, http etc. My only concern is that the name "Practical Go Lessons" doesn't seem to capture this, but I don't know what else would you name it.
I haven't taken a look at it yet. Can you summarize what it offers that Donovan & Kernighan's "The Go Programming Language" doesn't? (Sincere question, not being snarky.)
Thanks for your question. "The Go Programming Language" is a well-written book. I have not read every line of it, so my answer might not be precise.
I will highlight some key aspects of my project:
I teach computer science in my free time in a small non-profit organization. Most of the students have no knowledge at all in the field. I wanted to write a book that anybody could use, not only to learn Go but also to learn how to code from the beginning.
I tried to explain every notion by imagining a student with no prior knowledge. I also added content about some key notions like encoding, some basic knowledge about what a computer is made of, what a pointer is ...
I also tried to keep a practical approach, with many examples. I also added a lot of drawings and screenshots. Images are sometimes more efficient than long explanations (this what I learned when I began to teach children).
Keep me updated if you have some time. I would love to hear your feedback ;)
Really impressive. I'm a full time Go coder now, and lately I feel that a lot mediocre tutorials are appearing. In the sense that they compare as fast food to a quality dinner. I skimmed through your book and found the things I wanted to see: how to test, error wrapping, proper use of interfaces, etc. Your book is quality food. Excellent job!
Hello andreagrandi, sorry to hear that, can you access the website now ? It's hosted on AWS with Amplify, I did not received any alerts regarding that.
The only warning I got was a Free-Tier limit alert.
Hi! Thanks for your reply, I found the problem. I'm using NextDNS and it blocks the domain because it's been registered only a few days ago. I've added it to the allow list and now it works, thanks!
After 2.5 years of writing, countless weekends and evenings, I released a book about the Go programming language.
The book is available for free on the website because I wanted to give something back to the developer's community :)
It is composed of 700+ pages, 41 chapters, and approximately 405 drawings/screenshots.
I tried to cover all the important topics that a new Go programmer should know.
At the end of each chapter, you can find a small Q/A and a bullet point list of key notions.
I would love to hear your feedback about it!