3,297 karma · joined Nov 15, 2012 (14y ago) · 1,171 submissions
comment 9y ago · link · parent
No.. So any creation or update can be a POST. If your operation is idempotent, then you can make it a PUT. If you take the subset of POSTS that are idempotent in your application, this is what could be made a PUT.
So a set operation foobar=50, would could be a POST, but since its idempotent, it could also be a PUT.
A increment operations foobar++, would have to be a POST, but could not be a PUT since it is not idempotent.
comment 9y ago · link · parent
comment 9y ago · link · parent
Compared to Java I have ported to Go, returning error + defer has led to much more localized (and this grokable) and less verbose error handling. Less verbose? I suppose this is not true if you throw exceptions and handle them all at the top (Go has panic for these kind of fatal events BTW), but if you regularly have try-catch-finally blocks, the Go approach is in fact less verbose.
comment 9y ago · link · parent
FWIW I've been using Go since 0.8 and this stuff isn't really an issue for me.
1. Panics should not cross package boundaries unless they are meant to be fatal!
2. "lack of inheritance": 90% of the time embedding does the job of inheritance for my use cases just fine. It also prevents a lot of stupid... (from me and others)
3. "poor dependency management through github links" For all my non-trival projects I always fork all my dependencies into their own repos and then link upstream as upstream. If there is not feature I want or bug that needs fixing, I update them every 6 mo - 1 yr. I do this with every language I use where my dependences are source code and not distributable libraries (.a, .so, .jar etc).
comment 9y ago · link · parent
Yikes. One common practice that would have avoided this is by using the just taken backup to populate stage. If the restore fails pages go out. If integration tests that run after a successful restore/populate fail- pages go out.
Live and learn I guess.
comment 9y ago · link · parent
Background for others: Most people in keto are running on mostly fatty acids and some ketones (for the things that can't use fatty acids) and a small amount of glucose from gluconeogenesis for the obligate glucose tissues (retina, small percentage of brain, etc).
If you take away the ability to use fatty acids then you have to run off ketones, which should work, but I don't know if the body can make enough (and maybe that is impacted too?). And if your body is using gluconeogenesis to make your essential glucose from protein, and that is inhibited, I would think those tissues would be in trouble (its called essential glucose for a reason).
comment 9y ago · link · parent
Which is silly considering a majority of wild browsers now support HTTP/2.
Thanks for pointing our the repo, I missed it before: https://github.com/squeaky-pl/japronto
His Go isn't horrible, but it could be written like this:
func hello(respWtr http.ResponseWriter, req *http.Request) {
text, status := []byte("Hello world!"), http.StatusOK
if request.URL.Path != "/" {
text, status = []byte("Not Found"), http.StatusNotFound
}
respWtr.WriteHeader(status)
response.Write(text)
}
Rather than: https://github.com/squeaky-pl/japronto/blob/master/benchmark...Also, limiting Go to use a single core is unfair because the Go GC is optimized for multi-core operation.
comment 9y ago · link · parent
Say what? When I do this kind of testing using wrk:
1. I use multiple clients
2. Each client uses a thread for every logical CPU
3. I usually use at least 256 connections
What is actually being tested here? This smells like a test to get a desired result.No to mention in regards to Go/Others:
1. He is using an RC
2. By default it uses all all cores, why handicap it?
3. He didn't share his code for his contestants, how can I trust this?comment 9y ago · link · parent
This is a deterrent and would be very disruptive to the owners conducting business. It would discourage investors from elevating questionable people to boards of directors.
It could be something like this: 1. Sell/auction assets 2. Pay fines and damages and debts 3. Split remaining proceeds amongst non-legally culpable share holders
comment 9y ago · link · parent
I read that remark as this: If corporations are people legally, there should be certain crimes that lead to their dissolution. I assumed this was the proposal: If a corporation does something evil enough, its leaders going to prison and paying a fine isn't enough, it should face the corporate guillotine which revokes its incorporation.
comment 9y ago · link · parent
I have a replica Remington Model 1858 black power revolver. It shoots lead balls which are easy to make, same with its percussion caps. The kicker is, once loaded, its tactically the same as any modern single action 6 shooter.
If things really got bad, I have a heard time imaging my .55 cal muzzle loading flint lock would be out of commission either. I'd save the cross bow for stealth actions and maybe hunting smaller game, for which it would rock.
There is also the fact it would take years to burn up all the ammo floating around out there, so this would be gradual.
comment 9y ago · link · parent
main.go:13 main.main(): highest level error;
Details: foo.go:8 foo.ExportedMethod(): mid level error;
Details: foo.go:42 foo.innerMethod(): low level error!
It provides handy helpers like GetRootErr and PanicToError too. I hope we can opensource it in the next month or two.comment 9y ago · link · parent
feature requests with no mind to maintainability/cleanup -> tech debt -> slow dev. velocity -> failure to deliver features for the businesses -> failure to retain/grow/compete
comment 9y ago · link · parent
>I don't view this as lower level, just more verbose and explicit.
Well in this case, aren't these the same? The Go flow shows the explicit spawning of a (go/co)routine and the reading and wring to a thread safe queue. The C# abstracts this so the Go is closer to what is actually happening (ie low level). I should point out, you say more verbose, but there isn't much, if any, of a line count hit here for Go compared to C#.
>but it's harder to read the operations—not knowing go, `await` makes a lot more sense than `<-`.
Fair point, but if you swap <- for await I'd think the Go is more clear for people equally unfamiliar with Go and if you are learning Go <- is a core operator you will learn early.
comment 9y ago · link · parent
But something struck me, the low level execution flow was much much more intuitive. I think this might be an example how simple syntactic sugar can make code much harder to reason about intuitively. I do write a lot of Go so maybe its just that... you tell me!