4 ms·
Some time ago I was writing some software in Go in my spare time (just for fun and I could spend my time how I liked it). As I wasn't completely sure what it sh
by arendtio 8y ago
Some time ago I was writing some software in Go in my spare time (just for fun and I could spend my time how I liked it). As I wasn't completely sure what it should look like in the end, so I thought it would be reasonable to skip writing tests in the beginning and just write the code and add tests afterward where they would be necessary.
Fast forward I had to write the whole code twice. The second time I wasn't completely sure how it should look like either, but I put a much greater emphasis on interfaces and modularity. That way I could guarantee that parts of the program were actually doing what they were supposed to do, which made the bug hunt so much more effective.
So sometimes the longer way is actually the faster one and experience matters when it comes to recognizing such situations.