550 karma · joined December 15, 2010
A hypermedia approach is the nice happy medium between a very static website and an SPA, not sure why so many people are close-minded about this possibility.
The project is open-source (https://github.com/quii/learn-go-with-tests) so there's a few options available to you.
In releases, you'll find PDFs and epubs, I'm pretty sure most epub readers will let you use a dark mode. Or you can just read the markdown files on GitHub, which also supports it.
This is the _only_ point where you can safely refactor, if your tests are failing how do you know you haven't broken something? So long as you keep things "green" you know you're ok
> The danger seems to be when you have to walk away from some code and you or whoever picks up your code doesn't know what you were up to.
Just don't do this. You're not "done" with the TDD cycle until you make it pass and have refactored.
I reflect this in my git usage too, roughly it goes
- Write a test -> Make it pass -> git commit -am "made it do something" -> refactor -> run tests (if i get in a mess, revert back to safety and try again) -> git add . -> git commit --amend --no-edit
> It seems "safer" to write tests that are going to stay broken until every little corner of everything works properly, even though this is less iterative.
The problem with this is how do you safely refactor when you have potentially dozens of tests failing?
A big point of this approach is it makes refactoring a continuous process and makes it easier because you have tests proving you haven't accidentally changed behaviour.
Your comment is exactly what I try to get across in the book but it's not always easy.
If you cant decide how you want something to look (as that's not always easy) just take a punt on something. Make sure it's a small decision and make something useful. Sure you might have to change it, but at least you'll be basing that on some real feedback.
Sure....
I echo your sentiments, in the README.md in the root i talk about how writing tests is how I generally try and solidify knowledge.
I watched a few videos from a Coursera course called "learning how to learn" (or something like that) and it talked about how making your own analogies and examples helps you memorise stuff. To me, this style of learning works along those lines.
I wanted to keep the various "versions" to hand as i developed it. I _could_ grab them from git but i found myself making little edits and copying and pasting, referring to them et al.
I am tempted to delete them and just leave the final version, will have a think
Or if you're feeling brave, feel free to contribute :)
It's a WIP project, there's a few other sections on integers and arrays but I hope to cover all the other Go features like channels, goroutines etc - all TDD'd
Once that's done I plan to do more involved examples, such as TDD-ing a basic webserver.
This is what I tried to address. "Too abstracted" is far too subjective. Is "map" on a collection too abstract?
Dont get me wrong, code can be too abstract. But dont mistake too abstract for the unfamiliar.
The best example of this is your confguration project. I am amazed how many well-intentioned projects there are to do with configuration when really all you need is environment variables. No libraries, works everywhere, with every language and easy to understand.
I think Pact and MJ have different advantages over each other.
Pact gives you more options but I think MJ is simpler to use and gives you options in terms of testing performance which is often neglected.
I suppose the main difference is
- As far as I can see, Stubby doesn't provide CDCs-like functionality and MJ does. The idea of this is you can make sure your fake endpoints are valid. A common problem with mocks is that they go out of sync with a real server so your build is green, but it shouldn't be
- No flaky functionality
- Doesn't require any particular system dependencies (npm, maven or anything like that)
In one instance saw how certain scenarios meant we weren't releasing connections which then killed the app.
I figured the requirements for both fake servers and CDCs in a lot of cases are the same. "Given a request, i want this response". So I thought, why not just define it once in configuration and be done with it. This stops the two things getting out of sync.
The wiki has lots of info as to how to use it and what the point of it is. Would appreciate any feedback, apart from mean things.
We primarily work with Scala and some other fancy databases like Cassandra and Marklogic. Dont worry too much if you dont have Scala experience, so long as you're clever and keen.
We're looking to fill a number of positions detailed on the website.