fbpx

Writing Good Unit Tests; Don’t Mock Database Connections

Writing Good Unit Tests; Don't Use Database Mocking

Unit tests are unbelievably important to us as developers because they allow us to demonstrate the correctness of the code we’ve written. More importantly, unit tests allow us to make updates to our code base with the confidence that we haven’t broken anything. In our eagerness to get 100% code coverage, however, we often write … Read more

Practical Patterns for Technical Writing

Practical Patterns for Techincal Writing

Writing technical documents like API or architectural documentation which exceeds a simple flow diagram can be a daunting task. If you have some experience with technical documents, you will probably agree that there is nothing more frustrating than bad documentation. Lately, technical writing has become a more important part of my job, so I put … Read more

Guard Clauses – How to Clean up Conditionals

Guard Clauses - How to Clean up Conditionals

One of the first concepts new developers learn is the if/else statement. If/else statements are the most common way to execute conditional logic. However, complex and nested if/else statements can quickly become a cognitive burden and compromise the readability of a program. Guard Clauses Guard Clauses leverage the ability to return early from a function … Read more

Range Over Ticker In Go With Immediate First Tick

Profile   Tick Toc Croc

The Go standard library has a really cool type – Ticker. Tickers are used when you want to do something at a regular interval, similar to JavaScript’s setInterval. Here’s an example: As per the docs, a ticker is a struct that holds a receive-only channel of time.Time objects. In the example at the beginning of … Read more