421 karma · joined July 12, 2011
view := Views{
DIV("myclass",
H1("Example HTML structure"),
Yowsa. No thank you."Our distributed application produces the same type of error after the same period of time in totally different data centers. We have no idea why, but moving data centers seems to help, so we just keep doing it. #YOLO"
"We've built a product on a data store and library we don't understand even the highest-level constraints of. That ignorance bit us in the ass at peak load. We patched over the problem and continue gleefully into the future. #YOLO"
These stories should be embarrassing, but they're seemingly being celebrated, or at least laughed about. Am I off base?
> somth
What? > Nobody wants to write and maintain matchers that
> look like: Expect(foo).To(EqualInt64(3))
And nobody does do that. Idiomatic Go is to write if foo != 3 {
t.Errorf("foo: expected 3, got %d", foo)
}
I truly cannot explain why _so many people_ find this style of testing _so objectionable_ that they invent entire DSLs to avoid it.Notice that I said "ensure", and not "describe" or "define". Because I think that's the disconnect. When you come from a dynamically-typed language background, I think you're more apt to believe your testing needs to describe/define your contracts, because you don't have a type system to leverage. But if you _do_ have a type system to leverage, the pathological context that justifies e.g. BDD is no longer valid, and tools like Ginkgo -- enabling "descriptive tests that can act as effective documentation" -- therefore don't make much sense. To me.
Those things aren't all bad, and _some_ of their lessons can be successfully "ported" to languages and ecosystems that don't suffer the same fundamental shortcomings as e.g. Ruby or Python. But when I see developers take e.g. the BDD ethos as axiomatic and just run with it, it makes me feel like they don't really understand what BDD is designed to address. Likewise with hyper-expressive testing DSLs, or the concept of "mocking" as it's normally used.
Forgive the loaded language, but bringing BDD et. al. to languages like Go feels, to me, like cargo-cult development.
So testing double(mocking) in Go is still a big headache
in version 1.2?
I'm confused by your meaning. Mocking hasn't ever been a headache in Go. You just tease apart your functional components by using interfaces, and then test at the boundaries with mock implementations.The best article I've seen on the subject is this one:
And maybe follow-up with this one:
> My brain requires braces to line up in the left column,
> anything else slows me down. Maybe I'm just old?
One amazing property of humans is our ability to re-shape ourselves in new environments; to literally learn new tricks. The handicap you identify here is only serving to diminish your potential. > Although the author touches on some real issues with
> writing applications in Go, I do not recommend this
> article. The author does not follow the recommended
> practice for writing Go applications and the author has
> misconceptions about the Go tools.
Strongly agree. The author's workflow is full of antipatterns. > The Go libraries are something very new. People who
> developed the libraries know them inside out. Outside of
> that group of people, there's certainly much less
> knowledge about them.
I guess it's a tautology that the people who developed something know it best, but you're being really disingenuous here by implying that only those people would be capable of doing a project like this. Go's stdlib HTTP server takes great pains to be accessible and powerful.Please don't meta-moderate my contributions to this community.
> I wear crocs to work.
And I guarantee you people take you less seriously as a result of it. You can say "their loss!" and scoff at the absurdity of it, but that's a coping, rather than fixing, mechanism. > Maybe the sentence was too harsh, but I have little
> sympathy for them.
I cannot rightly comprehend the sociopathy that assembles the facts of this case and renders a judgment like the above. I hope you never need stand before a jury of your peers.