On Thu, 15 Dec 2016, 07:50 Alan Donovan <adono...@google.com> wrote: > On 14 December 2016 at 15:13, Dave Cheney <d...@cheney.net> wrote: > > For example, net/http contains both http client and server facilities, > because they both relate to the use of http. The prevailing style in other > languages would have these placed in separate packages, one for client, one > for server, and a third for things which are common to both. I think this > is unnecessary. > > > There's a case to be made here for the combined power of internal packages > and aliases (as proposed for Go 1.8). From the user's perspective, a > single net/http package makes sense, but for the maintainers, breaking it > up may lighten their burden. > > Within Google, the Go implementation of our in-house RPC system is a > complex beast that would benefit from a little modularity, but we can't > break the package up without changing its API. With aliases, it would be > possible to define separate internal packages for common declarations, for > clients, and for servers, and then define a "facade" package that exposes > just the API. >
That pattern is heavily prescribed in the Ruby on Rails community to combine dozens of files into single giant class. It's not a pattern I want to see replicated in Go. If you want to build mega objects the pattern that k8s uses of composing a giant interface is IMO, better. > I realize you are no fan of the aliases proposal, but I think it provides > real opportunities to solve problems of "programming in the large" that > aren't just about temporary refactoring. > I've retired hurt from the alias debate, but I'll bet you a steak dinner next time I'm in NYC that aliases will have caused an unexpected increase in circular dependency problems because aliases obscure the true declaration of a symbol. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.