TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Stages of learning Go, with code examples

170 pointsby beliuabout 10 years ago

9 comments

bonn1about 10 years ago
Just wondering, does Go finally has a package manager with proper versioning of modules?<p><i>Edit: Somebody is heavily downvoting me on every reply, I would love to know why. I like Go and want to get into it since a few months but the missing package manager held me off. So what is wrong about my question?</i>
评论 #9106381 未加载
评论 #9106067 未加载
评论 #9105976 未加载
评论 #9107939 未加载
评论 #9107411 未加载
评论 #9107351 未加载
评论 #9107198 未加载
coldteaabout 10 years ago
Where does this idiotic idea cames from that being &quot;idiomatic&quot; is some kind of virtue?<p>Idiomatic Java was the FactoryProxySingleton EE-wank fest from Apache, SUN, Spring and co.<p>It was by changing those idioms around (e.g. how the Play framework wrote Java), that saner alternatives emerged.<p>The de-facto idiom of PHP before 2010 was messy code.<p>It started getting more coherent after that, but the preffered idiom now (e.g. for Zend, Synmphony, Laravel) is still a tedious, verbose, copy of the Java circa 2006 style (large class hierarchies, singletons, &quot;Facades&quot;, DI, etc).<p>Idiomatic JS pre-Cockford was ad-hoc BS. After Cockford it got a lot better, but then it changed again (can&#x27;t say for the worse) with all sort of functional tricks and patterns that weren&#x27;t in vogue before.<p>In all of those cases, if they have stuck to the same &quot;idiomatic&quot; way from the start, it would have been worse.<p>Within a single project, sure, enforce some idiomatic way of doing things.<p>But within a whole language people should be able to experiment and not be called upon for being &quot;unidiomatic&quot; all the time. This is exceptially disturbing and often in Go, where there&#x27;s some cargo cult in many advocates that they have found the be-all end-all way to code.<p>It seems to me this push for &quot;idiomatic&quot; is also related to the Blub paradox. Blub programmers know a couple of ways of doing things (the &quot;idioms&quot; of their language) and cannot understand why someone might want to program with higher (or just different but convenient) concepts he learned in another language.
评论 #9107638 未加载
评论 #9107899 未加载
评论 #9107986 未加载
评论 #9109612 未加载
DanWaterworthabout 10 years ago
&gt; Phase 4 (the expert): You understand the design choices and motivations behind the language. You grok the philosophy of simplicity and composability.<p>In what way is Go code composable?
评论 #9106225 未加载
评论 #9106080 未加载
Animatsabout 10 years ago
It&#x27;s a tool, not a religion. Don&#x27;t try to turn it into a cult.
评论 #9105908 未加载
评论 #9106049 未加载
评论 #9107353 未加载
评论 #9105911 未加载
评论 #9107285 未加载
politicianabout 10 years ago
What do GOPATH, the project folder structure, package management, and package versioning all have in common? The go command. Not the linker, not the compiler -- the `make` replacement.<p>If you want to fix the most broken parts of Go -- its ecosystem management tooling -- just replace your `go` command.<p>I have, and I love working on a project with a proper top-level src folder, with vendor-able packages discoverable in a top-level lib folder pinned to known-good commits.<p>There are literally dozens of go replacements, but the winning combination for me is using Goop [1], Makefiles, and symlinks to subvert `go get` and the naive way it parses import declarations [2].<p>[1] <a href="https://github.com/nitrous-io/goop" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nitrous-io&#x2F;goop</a><p>[2] <a href="https://golang.org/ref/spec#Import_declarations" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;ref&#x2F;spec#Import_declarations</a>
评论 #9109792 未加载
copsarebastardsabout 10 years ago
&gt; <i>Don’t wait until you become an expert in the language to make your voice heard.</i><p>You can do anything!<p><a href="https://www.youtube.com/watch?v=gSjLiQxEZlM" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=gSjLiQxEZlM</a>
kylequestabout 10 years ago
&quot;If you think the Go standard library is not powerful enough to do what you want to do, you might be wrong.&quot;<p>or not...<p>The standard libraries are not perfect. They do have very useful building blocks, but they are far from complete or perfect.<p>Take the http library, for example. There&#x27;s no built-in context:<p>type HandlerFunc func(ResponseWriter, <i>Request)<p>type Handler interface { ServeHTTP(ResponseWriter, </i>Request) }<p>This resulted in a complete mess when it comes to http middleware because everybody is solving the context problem their own way (including google itself).
tgeeryabout 10 years ago
If they just made the page wider, I might be able to read their code samples with minimal effort...
runebabout 10 years ago
Can someone recommend some good books on Go?
评论 #9107390 未加载
评论 #9106972 未加载
评论 #9107272 未加载