News for hackers. Stuff that matters.
Re:Go Proverbs: Simple, Poetic, Pithy by sleepychu on Friday April 01, 2016 @03:23AM (#11403285)
"A little copying is better than a little dependency."

I like this but how do you protect yourself against growing into a lot of copying?

Re:Go Proverbs: Simple, Poetic, Pithy by falcolas on Friday April 01, 2016 @09:54AM (#11404752)
Personally, I use the rule of three. If it's copied three times, refactor it into some form of dependency. At that point, you should understand the use case, and should be able to create a reasonably designed API.
Re:Go Proverbs: Simple, Poetic, Pithy by krishicks on Friday April 01, 2016 @11:51AM (#11405722)
When doing this, be wary of what a friend of mine calls "misfactoring", an example of which being where you take three very similar, very readable bits of code and convert them into a single, parameterized mess that isn't understandable at all.
Re:Go Proverbs: Simple, Poetic, Pithy by shurcooL on Friday April 01, 2016 @05:13AM (#11403626)
Don't do a lot of copying.
Re:Go Proverbs: Simple, Poetic, Pithy by pjmlp on Friday April 01, 2016 @04:09AM (#11403441)
Apparently go generate

https://blog.golang.org/generate

Re:Go Proverbs: Simple, Poetic, Pithy by jankiel on Friday April 01, 2016 @09:37AM (#11404642)
Looks kind of ugly to be honest
Re:Go Proverbs: Simple, Poetic, Pithy by pjmlp on Friday April 01, 2016 @10:20AM (#11404925)
Agreed, but this is best you can get, since g* are never going to be available.