“Package names are central to good naming in Go programs. Take the time to choose good package names and organize your code well. This helps clients understand and use your packages and helps maintainers to grow them gracefully.”
I started playing with gotcl
and one of the first things I did was fork it and merge the project with gotclsh
. I even added a few examples in order to make sure it worked; and it did.
Next, I started working on a framework where tcl was going to be an interpreted scripting language used as part of the “work” that needed to be accomplished. It’s possible to call this work something like the node in a flow based program. In this case it was part of the details of the installinator
which I’ve written about.
When I initially merged the tcl projects I named the project ‘tcl’ and did not care a lick that I had changed the project name but not the package name. As I started practicing with my project and working out the basic kinks I realized that there was a problem with the repo name and the project name. In the end I renamed everything back to ‘gotcl’ and went to bed.
After a day of banging on the keyboard and a relaxing drive to the local toy store I realized that “we” had not read the book. Actually there is no book but there is plenty of common sense missing.
- The project is written in go, so there’s no need to name it gotcl
- The project cannot be compiled unless you use the go tools
- Go in the package name is redundant and repetitive
- It’s silly but that’s two more characters to type… everywhere
- Looking at the number or curated go projects with go in the name… shame and embarassment
The go tcl package should be named tcl and only tcl. Nothing else. It’s time to reread that article above.