4 ms·
> I’ve been picking up Go lately, and I wanted to apply it to a project that I could sink my teeth into. > What I came up with is very-much-not-idiomatic-go, b
by 59nadir 11y ago
> I’ve been picking up Go lately, and I wanted to apply it to a project that I could sink my teeth into.
> What I came up with is very-much-not-idiomatic-go, but it does map (basically) line for line with the original Turbo Pascal.
Why not use this as an exercise in how to write idiomatic Go? The backdrop of wanting to apply Go isn't exactly followed up on if you're just going to copy completely different idioms without any regard for your new language.
I know it's touched upon later in the piece, but it really doesn't make sense to make this an afterthought.
- accnumnplusone 11y agoAgreed. Seems to be a lot of disregard for the idioms from people picking up Go. I've recently had myself removed from a pairing where the project was some sort of ghastly java oriented Go. Not enjoying it.
- musha68k 11y agoThat's a real shame indeed as the biggest strength of Go IMHO is exactly the culture it emerged out of. Reading the source of the Go stdlib is a good exercise in preparation of "letting go" of your idiosyncratic perspective. In that regard it doesn't matter if you are coming from Java or Haskell or any other "world". "Perspective is worth 80 IQ points." - Alan Kay (who probably hates Go but that's OK too ;)
- accnumnplusone 11y agoI've read a decent amount of the std lib in the near 3 years I've been using Go. I think the idiosyncratic perspective is that of the people who are unable to let go of the language they're coming from and adapt to the new one. Bringing ideas to an ecosystem is one thing, disregard is another. While I'm here I'll throw in mention of npm-style 3 line function packages I've been encountering. I think you've presumed too much about my perspective, and lost out on that 80.
- dcw303 11y agoThat's a fair point. It wasn't so much that I was deliberately trying to ignore the idioms, but more that I wanted to write a translation in a current language to accompany someone who was working through the tutorials. Some may find that useful, others may not. I'm totally fine with that. As a separate project I would certainly like to write a compiler that takes advantages of go's features.