4 ms·
> package go_koans Hmm. I wouldn't trust this very much.
by sagichmal 12y ago
> package go_koans
Hmm. I wouldn't trust this very much.
- Kiro 12y agoWhy?
- tmhedberg 12y agoThe canonical Go style eschews underscores in package names.
- tptacek 12y agoIt seems like a superficial tabs-versus-spaces kind of point, but when you see how the standard library is organized and how package names interact with actual programs, you grok why underscores make people wince; "foo_bar" should either be "foo/bar", or just plain "bar". The import statement at the top of the file can clarify what the origin of a package is, but in the program body itself, the package name should make the library feel as natural as "fmt" or "io" or "math".
- myg204 12y ago'package koans' is simpler and more idiomatic of Go.
- Oxdev 12y agoLooks like a pull request to fix that has been submitted and it's a naming convention in golang. https://github.com/cdarwin/go-koans/pull/9 https://github.com/cdarwin/go-koans/pull/9
- sagichmal 12y agoIt's not just the package name. It's the definition and use of assert, the strange __typenames__, the overall approach. In my opinion, learning the language this way would imbue the student with awkward and incorrect intuitions about the language and its idioms.
- tokenizerrr 12y agoMy interpretation is that the __typenames__ are merely there as placeholders so the program will compile, but fail at runtime during the tests. It's a tad odd, but the user is meant to replace the __typenames__ with their own values to make the tests pass. While doing so the user would be reading all of the code, and hopefully wind up grokking it.
- pests 12y agoI feel a lot of people in this thread are not grokking the concept of the post itself. To add to what you said, the asserts are only there to test your knowledge of the correct value of the variable.