Proliferation of small packages

John Arbash Meinel john at arbash-meinel.com
Thu May 30 06:04:04 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave mentioned discussion on the CL wasn't the best place, so I'm hoping
to continue the discussion on juju-dev.

Note that I'm genuinely interested to hear what the alternatives are. I
don't particularly prefer giant lists of imports, but I *do* really like
small focused functionality that makes it easy to reuse.

On 2013-05-30 8:19, dave at cheney.net wrote:
> I will add a note of sadness that the import list at the top of
> most of our files is starting to resemble java in its verbosity.
> While not directly related this proposal, I do see it as a result
> of trying to define our packages at a very fine level of
> granuality; above what I believe is necessary.
>
Isn't that the Unix philosophy? Small focused bits of functionality,
that you can reuse and combine into something useful?

It also seems to be espoused in the Go documents that *I've* read.
That you should have things like

one.New()
two.New()

rather than

all.NewOne()
all.NewTwo()

A clear example of this is something like:
  http://golang.org/pkg/encoding/

Where every encoding is its own sub-package, rather than one package
that has bits for each thing.

The other bit is that Go doesn't let you talk about imports of imports
(probably for good reason). But it means that if package X uses
instances from package Y, something that needs to declare a var, needs
to import both X and Y.


If you can give rough outlines of what you think it should look like,
I'd certainly be interested to hear about it.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlGm69QACgkQJdeBCYSNAAMwSQCg2Y7uuP27hjvGAZ52msGJMKb9
yygAnRfEwAoTtrILVT6LcPoUuq+n5Fhe
=RZPk
-----END PGP SIGNATURE-----



More information about the Juju-dev mailing list