Hi. Could you (or anyone else here!) kindly answer this question:
https://news.ycombinator.com/item?id=14934690
One way to get your correct answer is for me to propose a wrong or partial answer. How is this as a message to the past (i.e. I am guessing your answer to the above request):
WRONG/FAKE ANSWER:
"Note to past self: although you can write code that compiles on day 1 and day 2, before considering your code idiomatic and ready to build on top of (or even deploy to production), DO/LEARN THE FOLLOWING:
1) read and work through all of The Go Programming Language book. This teaches all idioms.
2) Practice and use Go's testing tools (built-in). Always use its reformat tool applied on every save from your IDE.
3) Begin using a better error and logging library than the built-in error passing idiom. Google this.
4) Use a debugger. Google this.
5) Security and versioning with go get is broken: Google this and learn vendoring with versions. Otherwise your code cannot go on production.
6) You control garbage collection frequency. Learn to set this. In emergencies disable it entirely to trade memory for latency to gain one or two milliseconds (approach hard realtime), for example when you are dropping requests. Then reenable when you can take the (very small) hit. Garbage collection is very efficient and low-latency.
7) Channels and concurrency (goroutines) do not work as described. Specifically:
- This link will solve your problems with channels: https://stackoverflow.com/questions/41200505/whats-the-best-...
Adopt it. Then they work as described.
For goroutines:
Follow this document - https://gist.github.com/pzurek/6642797
After incorporating the above specific changes, you are ready to commit to production and build on top of what you want to build.
"
is the above message completely wrong and bullshit? Then please correct it.
Your insight and experience are appreciated and I would love to read what you would write as a message to yourself in the past, to save those lost months. Thank you.