

Tell HN: Ask Golang is my vacation project - carbocation
http://askgolang.com/thread/59

======
zura
Can anyone recommend some high-level/architecture/design patterns
books/materials about Go? (e.g. similar to SICP or Art of Prolog, or maybe
GoF).

~~~
acc01
<http://golang.org/doc/effective_go.html>

(aside: how is GoF "high-level/architecture/design"? it is just a collection
of tricks for overcoming language inexpressiveness)

~~~
elemeno
GoF is, in my opinion, about establishing a language to talk about commonly
used constructs in languages - especially given it's providence in Christopher
Alexander's A Pattern Language.

Referring to it as 'a set of tricks' would suggest to me that you've only
given it a cursory glance and assumed that it's just about copying out example
blocks of code, or that you've not worked in a wide enough set of languages to
realize that every language has commonly used patterns for doing particular
things, no matter how expressive the language is. Having a way to discuss the
architecture of a piece of software without having to explain every
implementation detail because there's already a shorthand refer to various
parts of it is invaluable when working on larger projects. Being able to call
a block of code as a flywheel is no more a trick than being able to refer to
an options pricing equation as a 'modified black-scholes' - the important part
is that other person knows from that what you're talking about and so you can
get to the important part of the conversation.

~~~
dragonwriter
> GoF is, in my opinion, about establishing a language to talk about commonly
> used constructs in languages

I think it philosphically comes in part from that place, but the particular
choice of constructs it addresses are a a commonly needed set that a
particular language family's lack of expressiveness in certain dimensions
required to be reimplemented using basically boilerplate code each time they
were used, so it spends a lot of time documenting the set of tricks necessary
to implement those constructs in that language family.

> you've not worked in a wide enough set of languages to realize that every
> language has commonly used patterns for doing particular things, no matter
> how expressive the language is

The more expressive a language is, the more the "commonly used patterns" can
be turned into libraries rather than templates you have to apply with
substitution each time you want to use them, and the less need there is for a
book documenting the justification with _sample_ code, as you just need the
actual _implementing_ code with documentation as to its _interface_.

OTOH, presentationally, its possible to document constructs is a pattern
language for software without as much attention to implementation in a
particular language as GoF provides. GoF particular choice of constructs and
its choice of how to present them, I think, are very much shaped by desire to
serve as an implementation cookbook -- a set of tricks -- for a particularly
industrially-popular programming language family _as well as_ providing a
common pattern language for software constructs that transcends particular
programming language choices (and its success and popularity are in no small
part due to its utility as a set of tricks.)

------
swalsh
Vacations are for relaxing! this is how people get burned out....I like the
idea though :D I've been wanting to learn go for a bit.

~~~
carbocation
> Vacations are for relaxing!

Maybe it wasn't exactly relaxing, but it has been fun!

> this is how people get burned out...

This is how I re-energize when taking a break from medicine :-)

------
kaoD
Margins, please.

------
salimmadjd
Quick question about golang. In your code, go.user / user.go You have a
Boolean function Guest(). Is this a common practice in Golang vs. writing it
as IsGuest() ?

Thanks for sharing, BTW!

~~~
carbocation
I'm not sure if this is wholly idiomatic. I based it on the following from
"Effective Go" [1]:

> _There's nothing wrong with providing getters and setters yourself, and it's
> often appropriate to do so, but it's neither idiomatic nor necessary to put
> Get into the getter's name._

Since I view "is/has" as derivatives of "get", I opted to omit the "is" from
Guest(). But I'm open to hearing other opinions.

There is probably plenty that is un-idiomatic all over this code and one of
the reasons I put it out there is to get feedback.

1 = <http://golang.org/doc/effective_go.html#Getters>

~~~
mseepgood
"GetX" is not idiomatic, but "IsX" seems to be idiomatic:
<http://golang.org/pkg/net/#IP.IsGlobalUnicast>

------
bridgeyman
Where do you host askgolang? I have been working on a go server with
websockets too. It seems like websockets cause trouble with Heroku, Google App
Engine, and AWS (if you use the ELB).

~~~
carbocation
This is on an instance of the smallest linode available (1024MB). It sits
there with all of my other side projects.

Load average is negligible despite the HN load:

    
    
        Load average: 0.04 0.06 0.06
    

I'm using Postgres on the backend and am not using any caching. This is being
reverse proxied by nginx (so that I can host multiple golang projects on the
same server over port 80).

------
bockris
It looks like the links are rendering backwards. e.g. src = text and text =
src

~~~
carbocation
Thanks for the heads up! I created my markdown links backwards; fixed.

------
mattdennewitz
fun idea, thanks for sharing.

can you please try some variations in type size and weight? this would go a
_long_ way for legibility between questions, answers, comments, meta info like
"submitted at", etc.

