Code and Climate Change. Blog about software development in the renewables sector. RSS Icon

Rust Impressions: One Month In

I've been working with rust at for a little more than a month now. Here's my first impressions, from someone who's never seriously worked with a low-level language before.

Testing and scope management in ASP.NET Core BackgroundServices

BackgroundServices in ASP.NET Core seem simple but can be tricky to get right. Here I'm going to try to write down what I wish I had known when I started, by answering the following questions: "How do I test my BackgroundServices", and "How do I manage scope inside my BackgroundServices"

ASP.NET Core IHostedService, BackgroundService and error handling

When I first started learning about ASP.NET Core, the IHostedService and the BackgroundService was a mystery to me.
I wasn’t quite clear on how to use them or what the difference between an IHostedService and a BackgroundService was or when I should use which.
I also didn’t know how to do error handling in them or why my BackgroundService started failing silently.
But pain is a harsh mistress and now I know better. Read on, and you can too.

Just Use FluentAssertions

Testing frameworks in C# generally have some built-in way to do assertions. Don't use them - use FluentAssertions instead. Here's why.

Object Equality and Testing

You should rarely implement Object.Equals. And you should definitely never do it for testing purposes. Here's why.

Don't Say Nice Things About People

Say it to them!
Once at a company dinner someone had to leave early. He was a new hire at the time and right after he left, everyone started talking about "what a great guy he is" and how "we’re lucky to have him." I don't think anyone ever told him the nice words we said about him that day. But I think someone should have.

Azure Event Hubs Are Not Queues

Unfortunately, I've seen quite a few people use Azure Event Hubs when what they really wanted was a queue. Event Hubs are great for large-scale data ingestion, but if you just need to pass messages between your services - use something else. Here's a few reasons why.

How Microsoft Teams Kills Knowledge Management

Microsoft Teams seems like it’s trying to be the one-stop tool for all your organisational needs. I think it works fine for chat and calls, but for knowledge management it is extremely unimpressive, often making things much harder than they need to be. Here’s four ways Teams is killing your knowledge management.

How To Not Get Blocked While You’re Waiting For A Code Review

You’ve made your awesome new Pull Request, but the person who has to review it won’t have time for several hours. While we all strive to review code as fast as possible, there’s always going to be delays. So what do you do while you’re waiting for that review?

4 Ways To Make Your Pull Requests Faster To Review

It can be frustrating to wait for someone to review your pull request. While everyone is interested in pull requests getting reviewed as fast as possible, reviewing code takes time. Here’s 4 ways to make your pull request as easy to read, and as fast to review as possible.

My Publishing Workflow

I’m trying to get a little more structured when it comes to how I publish and syndicate the content I write. These are primarily my notes to myself about my process, but maybe you’ll find them interesting.

On Inclusive Language In Tech

Twitter recently announced that they're beginning to change many of the terms they use, to "more inclusive" variants. Is it all just virtue signalling, or are the new words better?

5 Reasons To Not Use Observables in C#

When I was first introduced to Observables in C#, they sounded pretty damn good. “They just model streams of data”, “It’s just data over time” and “It’s just the push equivalent of an IEnumerable”. After working with them for a little while, I don’t think they’re as good as I was told.

Static Factory Methods vs Constructors In C#

Recently while pair programming with a colleague, we got into discussing the best way to initialize new objects in C#. I’ve always just implemented constructors and left it at that, while he tended to favour static factory methods. This led to a lot of discussion and back-and-forth about the pros and cons of each type.

To Serverless or Not To Serverless

Internally at SCADA MINDS, we’ve had a lot of discussion whether or not to use serverless, Azure functions to be more specific, for a large project. This is my attempt to give a balanced overview of the pros and cons of Serverless, to help us make the right decision.

Prettier for C# - Developing an auto-formatting pre-commit hook

Many programming languages have automatic formatters. Go has gofmt, Rust has rustfmt, JavaScript has prettier and python has black. Being able to, in an editor-independent way, have your code automatically formatted without having to worry about it, is extremely freeing. It means there's a whole slew of religious wars you don't have to fight, and it means you never have to review a pull request with a bunch of noise, because this particular editor or user thinks the braces belong on some other line than they were. Unfortunately C# doesn't really have an equivalent, but here's my attempt at making one.

An In-Depth walkthrough of Djangos Default Middleware

This is a very in-depth walkthrough of what the different pieces of Djangos default MiddleWare does, and how it relates to django-rest-framework. Most of this isn’t particularly relevant to know unless you’re debugging a Middleware issue - in that case it’s invaluable information.

Choosing between Babel and TypeScript

Projects using babel can now use TypeScript without having to include the typescript compiler. But should you? We look at the pros and cons of each.

How to Read Programming Error Messages

Much of modern development now is searching for the right things. Error messages can be tricky if you're new or working on a new stack. This is a short guide about the anatomy of an error message - what parts there are, which are important and which can be ignored.

4 Future Challenges for TypeScript

TypeScript is great, but it has issues. I outline the four challenges I think are most important to pay attention to, to ensure that TypeScript remains great.

State of Voice Coding 2017

We take a look at how Voice Coding looks in 2017, new advances in speech recognition engines and different systems.

Overcoming Repetitive Strain Injury(RSI): What worked and what didn't

About a year ago I started having pain in my left pinky. At the time I was a student, and had just helped start bambuu where I develop software. I figured the pain was temporary so I kept on working, thinking it’d go away by itself. This would be a very short blog post if I was right. After while it had spread to my right pinky as well.

Relative deprivation and the big picture.

I recently read Malcolm Gladwell’s book “David and Goliath – Underdogs, Misfits and the Art of Battling Giants.” Gladwell writes about a phenomenon called relative deprivation – when we are deprived of something, relative to the people around us. I’m going to talk a little about this phenomenon, and how it relates to keeping the big picture of the world in mind.