What would you remove from Go?
When we talk about improving a programming language, we often think about what features we would add. Things like generics in Go, async/away in JS, etc. In this episode we take a different approach and talk about what we would remove from Go to make it better.
Discussion
Sign in or Join to comment or subscribe
Emil Pirfält
2020-11-14T15:18:07Z ago
I would remove package names.
Packages are already related to directory structure. Both in that all files in a directory must share a package name and in the path which is used for imports.
Naming the package again within the file(s) only add an opportunity for mistakes, since I always want to use the directory name as the package name.
In my experience the relationship between packages and directories was one of the hardest required thing to learn when starting to use go. Other non required things are harder.
Counterpoints. The ‘_test’ and ‘main’ packages are useful. The “/pkgname/v2” should not be named “v2”.