Hardly. The Go philosophy is "our language is designed to not need such architecture-astronauts' high-brow fanciness". Other than that, whatever architecture/design patterns you're used to should mostly carry-over to Go.
A change is as good as a rest. Maybe coding isn't his primary 'job'? I myself started on the business side, so the evenings and weekends learning to code were great fun and I definitely didn't see them as negative
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() ?
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.
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).
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).
I've been working with websockets on AWS for some data intensive bi-directional communication and haven't had any issues with it...However, I don't have it set up as an HTTP listener, I have it set to TCP 80 -> TCP <mylocalport>. The server architecture doesn't matter if a user drifts backend hosts if their connection drops and reestablishes (no stickiness needed). I haven't tried it under the HTTPS setting for SSL connections yet, but if there's flakiness, I know I can just terminate SSL on the ec2 instances instead of the ELB.
Another thing to mention: I believe websockets use up file descriptors. If you are having issues with websockets despite nominal load, it's worth checking if you're exhausting your file descriptors.
I don't know about the architecture of Heroku, GAE, or AWS w/ ELB in terms of supporting the HTTP 1.1 Upgrade request to websockets. Perhaps they all use a reverse proxy that doesn't pass along the Upgrade request? Even nginx didn't support this before ~1.3.13.
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.
[+] [-] zura|12 years ago|reply
[+] [-] acc01|12 years ago|reply
(aside: how is GoF "high-level/architecture/design"? it is just a collection of tricks for overcoming language inexpressiveness)
[+] [-] dualogy|12 years ago|reply
Hardly. The Go philosophy is "our language is designed to not need such architecture-astronauts' high-brow fanciness". Other than that, whatever architecture/design patterns you're used to should mostly carry-over to Go.
[+] [-] swalsh|12 years ago|reply
[+] [-] carbocation|12 years ago|reply
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 :-)
[+] [-] inovica|12 years ago|reply
[+] [-] kaoD|12 years ago|reply
[+] [-] salimmadjd|12 years ago|reply
Thanks for sharing, BTW!
[+] [-] carbocation|12 years ago|reply
> 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
[+] [-] TylerE|12 years ago|reply
[+] [-] Jabbles|12 years ago|reply
[+] [-] bridgeyman|12 years ago|reply
[+] [-] carbocation|12 years ago|reply
Load average is negligible despite the HN load:
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).[+] [-] ismarc|12 years ago|reply
[+] [-] carbocation|12 years ago|reply
I don't know about the architecture of Heroku, GAE, or AWS w/ ELB in terms of supporting the HTTP 1.1 Upgrade request to websockets. Perhaps they all use a reverse proxy that doesn't pass along the Upgrade request? Even nginx didn't support this before ~1.3.13.
[+] [-] bockris|12 years ago|reply
[+] [-] carbocation|12 years ago|reply
[+] [-] mattdennewitz|12 years ago|reply
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.