Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
lots of small nested packages
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
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:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joel Reymont  
View profile  
 More options Aug 30 2012, 1:38 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Pike  
View profile  
 More options Aug 30 2012, 2:13 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel Reymont  
View profile  
 More options Aug 30 2012, 2:19 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Pike  
View profile  
 More options Aug 30 2012, 2:20 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Pike  
View profile  
 More options Aug 30 2012, 2:20 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steven Degutis  
View profile  
 More options Aug 30 2012, 2:25 pm
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel Reymont  
View profile  
 More options Aug 30 2012, 4:20 pm
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.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kyle Lemons  
View profile  
 More options Aug 30 2012, 4:49 pm
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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tomwilde  
View profile  
 More options Aug 31 2012, 9:58 am
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »