Re:Dumping PHP For Go
by sirclueless on Tuesday July 10, 2012 @12:45AM
(#4222170)
All sensible web programming environments have a stateless programming model
By default, Go doesn't. The default HTTP server in Go works by calling into your code via a callback, and you are free to maintain any state you wish across requests.[1]
I don't consider this a problem in Go, because the good module system and scoping rules mean that global state is explicit and obvious, and a good concurrency model means that accessing global state can be done safely. Global state can be useful and performant, so I'm glad Go lets you take advantage of it, but it might rule it out as a "sensible web programming environment" by your definition.
Re:Dumping PHP For Go
by nl on Tuesday July 10, 2012 @04:36AM
(#4222678)
Yes, that is a fair point. Perhaps I could have better said that all sensible web programming environments give you access to a stateless programming model.
I don't consider this a problem in Go, because the good module system and scoping rules mean that global state is explicit and obvious, and a good concurrency model means that accessing global state can be done safely. Global state can be useful and performant, so I'm glad Go lets you take advantage of it, but it might rule it out as a "sensible web programming environment" by your definition.
[1] http://golang.org/pkg/net/http/#ListenAndServe