lots of small nested packages
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
Joel Reymont <joe... @gmail.com>
Date: Thu, 30 Aug 2012 10:37:55 -0700 (PDT)
Local: Thurs, Aug 30 2012 1:37 pm
Subject: lots of small nested packages
What is the party line on small nested packages?
Think a number of them like signal, all nested under os.
In my case, I'm thinking of making small individual packages for
various financial instruments, all under my trade package, e.g.
github.com/wagerlabs/go.trade/stock
github.com/wagerlabs/go.trade/option
github.com/wagerlabs/go.trade/future
etc.
Among other things, this would allow me to have functions like
stock.Make instead of trade.NewStock, something that I much prefer
aesthetically.
Thanks, Joel
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Rob Pike <r... @golang.org>
Date: Thu, 30 Aug 2012 11:12:55 -0700
Local: Thurs, Aug 30 2012 2:12 pm
Subject: Re: [go-nuts] lots of small nested packages
It's too general a question for a specific answer, but it sounds like
a fine approach to try.
-rob
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Joel Reymont <joe... @gmail.com>
Date: Thu, 30 Aug 2012 11:19:10 -0700 (PDT)
Local: Thurs, Aug 30 2012 2:19 pm
Subject: Re: lots of small nested packages
On Aug 30, 7:13 pm, Rob Pike <r... @golang.org> wrote:
> It's too general a question for a specific answer, but it sounds like
> a fine approach to try.
Thanks Rob!
A related question then...
Is there a way to have 'go build' rebuild -all- nested packages from
the top of the tree?
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Rob Pike <r... @golang.org>
Date: Thu, 30 Aug 2012 11:20:17 -0700
Local: Thurs, Aug 30 2012 2:20 pm
Subject: Re: [go-nuts] Re: lots of small nested packages
cd wherever
go build ./...
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Rob Pike <r... @golang.org>
Date: Thu, 30 Aug 2012 11:20:43 -0700
Local: Thurs, Aug 30 2012 2:20 pm
Subject: Re: [go-nuts] Re: lots of small nested packages
You probably want
go install ./...
though.
-rob
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Steven Degutis <sdegu... @8thlight.com>
Date: Thu, 30 Aug 2012 11:25:31 -0700 (PDT)
Local: Thurs, Aug 30 2012 2:25 pm
Subject: Re: lots of small nested packages
I like the idea. One note though, I think the idiom is stock.New() instead of stock.Make() -Steven
On Thursday, August 30, 2012 12:38:02 PM UTC-5, Joel Reymont wrote:
> What is the party line on small nested packages?
> Think a number of them like signal, all nested under os.
> In my case, I'm thinking of making small individual packages for > various financial instruments, all under my trade package, e.g.
> github.com/wagerlabs/go.trade/stock > github.com/wagerlabs/go.trade/option > github.com/wagerlabs/go.trade/future
> etc.
> Among other things, this would allow me to have functions like > stock.Make instead of trade.NewStock, something that I much prefer > aesthetically.
> Thanks, Joel
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Joel Reymont <joe... @gmail.com>
Date: Thu, 30 Aug 2012 21:20:35 +0100
Local: Thurs, Aug 30 2012 4:20 pm
Subject: Re: [go-nuts] lots of small nested packages
Rob,
On Thu, Aug 30, 2012 at 7:12 PM, Rob Pike <r
... @golang.org> wrote:
> It's too general a question for a specific answer, but it sounds like
> a fine approach to try.
Please take a look here:
https://github.com/wagerlabs/go.trade
I restructured everything into small packages and I like it, personally.
--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Kyle Lemons <kev... @google.com>
Date: Thu, 30 Aug 2012 13:48:49 -0700
Local: Thurs, Aug 30 2012 4:48 pm
Subject: Re: [go-nuts] lots of small nested packages
Be wary of making packages *too* small. My probably unhelpful suggestion
is to make a package only as big as it needs to be to be to accomplish a
task. Often you can tell you may be making them too small if you find
yourself needing unexported state from another package or you find you are
introducing a circular dependency.
On Thu, Aug 30, 2012 at 10:37 AM, Joel Reymont <joe
... @gmail.com> wrote:
> What is the party line on small nested packages?
> Think a number of them like signal, all nested under os.
> In my case, I'm thinking of making small individual packages for
> various financial instruments, all under my trade package, e.g.
> github.com/wagerlabs/go.trade/stock
> github.com/wagerlabs/go.trade/option
> github.com/wagerlabs/go.trade/future
> etc.
> Among other things, this would allow me to have functions like
> stock.Make instead of trade.NewStock, something that I much prefer
> aesthetically.
> Thanks, Joel
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
tomwilde <sedeveloper... @gmail.com>
Date: Fri, 31 Aug 2012 06:58:26 -0700 (PDT)
Local: Fri, Aug 31 2012 9:58 am
Subject: Re: lots of small nested packages
Because the different asset types (I imagine) share a considerable part of their behavior, I would put them into a single package. Separating them in different packages may give you trouble in the future and force you to export currently unexported methods or types in order not to repeat code in the other asset type packages. It's best to keep closely related concept bundled together. Am Donnerstag, 30. August 2012 19:38:02 UTC+2 schrieb Joel Reymont:
> What is the party line on small nested packages?
> Think a number of them like signal, all nested under os.
> In my case, I'm thinking of making small individual packages for > various financial instruments, all under my trade package, e.g.
> github.com/wagerlabs/go.trade/stock > github.com/wagerlabs/go.trade/option > github.com/wagerlabs/go.trade/future
> etc.
> Among other things, this would allow me to have functions like > stock.Make instead of trade.NewStock, something that I much prefer > aesthetically.
> Thanks, Joel
You must
Sign in before you can post messages.
You do not have the permission required to post.