Applied Go

appliedgo.net · Personal blog · on HN since 2016

Applied Go publishes Go tutorials and essays on topics like generics workarounds, goroutines, TUIs, binary trees and MapReduce.

What HN saysHN commenters link its generics post as idiomatic workarounds for Go's missing generics, though one criticizes the author's error handling understanding.
25HN people shared it
6linked it in comments
26stories submitted
191story points
10 months agolast shared
2016people per year2026

Most-shared posts

  1. 1
    GoLang: Who needs generics? Use ... instead
    8 people · 10 points · first shared 2016 · 2 comments on HN
  2. 2
    Slow down your code with goroutines
    3 people · 10 points · first shared 2019 · 1 comments on HN
  3. 3
    Perceptrons – the most basic form of a neural network
    1 people · 116 points · first shared 2016 · 19 comments on HN
  4. 4
  5. 5
    Building a Binary Search Tree in Go
    1 people · 6 points · first shared 2016 · discussion on HN
  6. 6
    Rapid AWS Lambda Development with Go and Mantil
    1 people · 3 points · first shared 2022 · discussion on HN
  7. 7
    MapReduce – munching through Big Data (2016)
    1 people · 3 points · first shared 2021 · discussion on HN
  8. 8
    Create PDFs from Go
    1 people · 3 points · first shared 2018 · discussion on HN
  9. 9
    Futures in Go, no package required
    1 people · 3 points · first shared 2020 · discussion on HN
  10. 10
  11. 11
    WaitGroup.Go() in 1.25
    1 people · 2 points · first shared 2025 · discussion on HN
  12. 12
  13. 13
  14. 14
    From CLI to Homebrew Using Golang
    1 people · 2 points · first shared 2025 · discussion on HN
  15. 15

What HN people wrote when they linked it

kerkeslager · 2020-04-23
Well, for one, you can learn from other people's mistakes, which is better than learning from your own, because then you don't have to feel the pain. Go is a deserving target for this criticism because the language itself deliberately made a lot of the mistakes other language communities made and learned from, like weak typing[1] and naive garbage collection algorithms. Literally if you opened an undergraduate textbook on either topic you'd see much better ways to do things. But early adopters argued vehemently that Go was simple and didn't need those things. It does seem like Go is learning from their mistakes here: they've introduced precise garbage collection and it seems like some form of generic or template types are inbound in the next few releases. Perhaps in a few years Go will be a language I am willing to work in. But it would have been nice if a new language which already had these problems worked out had become popular, instead Go, which has reached popularity through hype rather than technical merit[2]. Tracking the history of template/generic types has been somewhat humorous: you can almost see it in this article[3] where the author starts in with the title "Who needs generics!", goes on to describe some frankly horrible ways to get around the lack of generics (it's amazing how complex Go's simplicity can be!) and finally backpedals in an update ("I am the last one to balk at the idea of generics in Go."). I don't mean this to be picking on the author here…
alexkavon · 2019-03-29
There's also always a package to handle that issue. [0][1][2] As well as other options. [3] I like to imagine that the "no generics, no way" crowd would never use the stairway in their building if the elevator broke down. [0] https://github.com/clipperhouse/gen [1] https://github.com/cheekybits/genny [2] https://github.com/cosmos72/gomacro [3] https://appliedgo.net/generics/
daenz · 2018-06-24
>Besides, I think think it even actually _is_ idiomatic since you used reflection. https://appliedgo.net/generics/ See point 4 and 5. It is idiomatic.
BlueMatador · 2017-04-20
You're right. Although a lot of people have written about this limitation in the language. Applied Go has a tutorial on how to use arrays, slices, or maps as a workaround for many generics need cases, much like it looks like Ply does. https://appliedgo.net/generics/
jerf · 2026-01-08
Author is still early in their exploration and has some definite mistakes in here. Probably the biggest one is around the error handling, thinking that the only way to interact with an error is through the error interface itself. That is intended as a baseline interaction, a fallback for when nothing else is appropriate, such as just slamming an error into a log. If you want to interact with specific errors, you should use the various functions in the errors package [1] to check for specific types, and then use those specific types in whatever they support. Go error support is quite good; you can return an error object that says "The user was not found, the file the user was supposed to be found in was not found, and while trying to log this the log failed to accept the write" as various error types composed together, and any consumer of the error using the errors package can pick out the various bits of the error they understand using those tools without having to understand the error binding them together or the components it doesn't care about . You should never use string manipulation to check errors unless you have no choice, and whatever library left you with no choice should have an issue filed against it. It doesn't come up often, but it does sometimes come up; most recently I had the AWS SDK emitting an error I could only use string functions on, but I think they've since fixed it. I don't like the term "enums" because of the overloading between simple integers…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close