A new addition to the Go standard libary is interning via the unique package, allowing developers to potentially reduce allocations and improve comparison performance.
A new addition to the context package in Go 1.20 is the ability to provide the cause of a context's cancellation. In this post we'll take a look at this new API and how to use it.
Currently going through Go's proposal process, the slog package aims to introduce structured logging as a first-class citizen within the Go standard library. In this post we take a look at the proposal, the package and what it does.
You build things differently when you expect them to fail, and in a complex distributed system that communicates across networks failures should be expected. To combat this Shopify build Toxiproxy, a tool for simulating a wide range of network conditions. In this post we look at how we can leverage Toxiproxy to introduce network failures into our tests, so we can better defend against them.
In my previous post I introduced HttpClientInterception , a hugely versatile .NET library that I’ve had great success with. In the post I demonstrated how you can use it to stub remote HTTP service dependencies within your application to ease testing. Towards the end of the post I demonstrated how it integrated with IHttpClientFactory via the IHttpMessageHandlerBuilderFilter interface,…
Recently I’ve been reading the new Software Engineering at Google book where I’ve found the chapters on testing to be particularly interesting. One paragraph that especially resonated with my own personal experiences with testing was the following excerpt: This chapter got me thinking a lot about my preference for testing units of behaviour as opposed to implementation details, and as…
Let’s begin with a short story. The sun is shining and you’re walking through a wood when you happen upon quiet, desolate road. As you walk along the road you encounter an rather peculiar placed fence running from one side of the road to the other. “ This fence has no use ” you mutter under your breath as you remove it. Removing the fence could very well be the correct…
C# has had a Tuple type ( System.Tuple ) for sometime now, however a re-occuring theme was it generally lacked the utility that tuples in languages with native support had. This partly due to the fact that it was really just a class utilising generics with no real language or runtime support, resulting in its adoption being rather limited. Since C# 7 and the introduction of the ValueTuple type…
One package I’ve been using with great success recently is Simmy , so much so that I feel it deserves its very own blog post. What is Simmy and why you should use it? Simmy is a fault-injection library that integrates with Polly, the popular .NET transient-fault-handling library. Its name comes from the Simian Army toolset , a suite of tools created by engineers at Netflix who recognised…
During my day to day programming activities I regularly find myself switching between various .NET Core solutions. At work we have a multitude of .NET Core microservices/microsites and at home I enjoy contributing to OSS projects/reading other people’s code. As I’m switching between these solutions I regularly come across a project that uses a global.json file to define the version of…
The team I work in at Just Eat have a number of HTTP based APIs which are consumed by other components, some in internally others externally. Like a lot of people building HTTP based APIs we use Swagger for both developer experimentation and documentation of the endpoints exposed. This is done via the Swagger UI, which uses an Open API document (formally Swagger docs) that describes the endpoints…
Just a quick post, nothing technically challenging but hopefully valuable to some none the less. It all started a couple of days ago when I found myself browsing through Microsoft’s Logging Abstractions library source code. For those that aren’t familiar with this library the aim of it (as the name suggests) is to provide a set of abstractons over the top of common APIs that have…
Having successfully applied Subcutaneous testing to a number of projects I was interested to see what options were available in ASP.NET Core. In this post we’ll touch on what Subcutaneous testing is, its trade offs and how we can perform such tests in ASP.NET Core. What is Subcutaneous Testing? I first learnt about Subcutaneous testing from Matt Davies and Rob Moore’s excellent…
The phrase “ the right tool for the job ” is one we’ve all heard in software development and we’ve all most likely said it at some point. However when you stop and think about what such a phrase actually means you begin to realise it’s actually quite a problematic one, it makes too many assumptions. One could also go as far to say it has the potential to be quite a…
Have you ever needed to skip a test under a certain condition? Say, the presence or absence of an environmental variable, or some conditional runtime check? No, me neither - that was up until recently. Skipping tests is usually a good practice to get into, but I use the word “usually” here because as with all things in software there sometimes certain constraints or parameters that may…
Hello! Sorry for the lack of posts recently - I haven’t died or lost interested in blogging, I’ve been super busy with multiple things one of which broke my site. For this curious here’s what I’ve been up to: Building the new DDD South West website Since getting involved with organising the DDD South West event last year , one thing that was unanimous around the team of…
For anyone that regularly reads this blog will remember that recently I developed a convention based ASP.NET Core exception handling library named GlobalExceptionHandler.NET ( if you missed the post you can read about it here ). GlobalExceptionHandler.NET in a nutshell GlobalExceptionHandler.NET hands off ASP.NET Core’s .UseExceptionHandler() endpoint and enables developers to configure HTTP…
Recently I gave a talk titled ‘Going serverless with AWS Lambda’ where I briefly went through what the serverless is and the architectural advantages it gives you along with the trades offs to consider. Half way through the talk I then went on to demonstrate the Serverless framework and was surprised by the number of people that are currently experimenting with AWS Lambda or Azure…
For sometime now I’ve been a huge proponent of Postman, working in an environment that has a large number of remote services meant Postman’s ease of generating requests, the ability to manage collections, view historic requests and so forth made it my goto tool for hand crafted HTTP requests. However there have always been features I felt were missing, one such feature was the ability…
Note: Whilst this post is targeted towards Web API, it’s not unique to Web API and can be applied to any framework running on the ASP.NET Core pipeline. For anyone that uses a command-dispatcher library such as MediatR , Magneto or Brighter (to name a few), you’ll know that the pattern encourages you to push your domain logic down into a domain library via a handler, encapsulating your…
In the past few years the command line has made a resurgence in the Windows world. With the .NET Core CLI now a first class citizen and the Linux sub-system for Windows making it easy to run Linux based tools on a Windows machine, it’s clear that Microsoft are keen to boost the profile of the CLI amongst developers. Yet Windows has always come up short on delivering a powerful grep…
Having recently attended a talk on GraphQL and read about GitHib’s glowing post surrounding choice to use GraphQL over REST for their API , I was interested in having a play to see what all of the fuss was about. For those that aren’t sure what GraphQL is or where it fits in the stack let me give a brief overview. What is GraphQL? GraphQL is a query language (hence QL in the name)…
Having been playing around with the ASP.NET Core 2.0 preview for a little while now, one cool feature I stumbled upon was the addition of the new ITagHelperComponent interface and its use. What problem does the ITagHelperComponent solve? Pre .NET Core 2.0, if you’re using a library that comes bundled with some static assets such as JavaScript or CSS, you’ll know that in order to use…
One of the strengths boasted by .NET Core is its new command line interface (CLI for short), and by now you’re probably aware that Visual Studio, Rider, Visual Studio Code etc shell out to the .NET Core CLI under the bonnet for most .NET Core related operations, so it makes sense that what you’re able to do in your favourite IDE you’re also able to do via the CLI. With this in…
As someone that organises and runs the .NET South West in Bristol , I’ve had a number of people online and in person approach me expressing an interest in starting a .NET focused meet up but not sure where to start; so much so that I thought it would be good to summarise the challenges and hurdles of running a meet up in a succinct blog post. Running a user group isn’t a sail in the…
Yesterday was my second time both attending and speaking at the DDD conference run out of the Microsoft offices in Reading, and as a tradition I like to finish the occasion by writing a short retrospective post highlighting the day. Arrival Living just two hours’ drive from Reading I decided to drive up early in the morning with fellow Just Eater Stuart Lang who was also giving a talk. After…
Saturday 6th of May marked the day of another great DDD South West event. Having attended other DDD events around the UK I’ve always felt they had a special community feel to them, a feeling I’ve not felt at other conferences. This year’s DDD South West event was particularly special to me not only because I was selected to speak at the conference, but because this year I was…
Having been experimenting and reading lots about C# 7’s tuples recently I thought I’d summarise some of the more interesting aspects about this new C# language feature whilst highlighting some areas and limitations that may not be apparent when first using them. Hopefully by the end of this post you’ll have a firm understanding of the new feature and how it differs in comparison…
Since jumping on the Docker bandwagon I’ve found its utility spans beyond the repeatable deployments and consistent runtime environment benefits that come with the use of containers. There’s a whole host of tooling and use cases emerging which take advantage of containerisation technology, one use case that I recently discovered after a conversation with Phil Jones via Twitter is the…
Recently I’ve been working on an ASP.NET Core application where I’ve needed to configure at runtime, the host address and port the webhost will listen on. For those that have built an ASP.NET Core app you’ll know that the default approach generated by the .NET CLI is less than ideal in this case as it’s hard-coded. After a bit of digging I quickly realised there…
For the past couple of weeks I’ve been working on an IL (Intermediate Language) Viewer for Visual Studio Code. As someone that develops on a Mac, I spend a lot of time doing C# in VS Code or JetBrains’ Rider editor - however neither of them have the ability to view the IL generated (I know JetBrains are working on this for Rider) so I set out to fix this problem as a side project. As…
It’s that time of the year again where I take a moment to reflect on the previous year and set some high level goals as to what I want to achieve or aim towards in the next. I find these types of post really helpful at tracking progress and ensuring I stay on a positive projection as a software developer/engineer - a hobby that I’m lucky enough to have as a career. Review of 2016 Last…
Recently I’ve been hard at work on my first Visual Studio Code extension and one of the requirements is to extract IL from a .dll binary. This introduces a question though, do I build the solution (blocking the user whilst their project is building), read the .dll from disk then extract the IL, or do I compile the project in memory behind the scenes, then stream the assembly to Roslyn?…
A fundamental problem with integration testing over finer-grained tests such as unit testing is that in order to integration test your component or application you need to spin up a running instance of your application so you can reach it over HTTP, run your tests and then spin it down afterwards. Spinning up instances of your application can lead to a lot of additional work when it comes to…
A little while ago I concluded that my blog was looking a bit long in the tooth and decided that since I’m looking at .NET Core, what better opportunity to put it through its paces than by rewriting my blog using it. I won’t go into too much detail as how the blog is built as it’s nothing anyone wouldn’t have seen before, but as someone that likes to read about…
Having recently spend a lot of time experimenting with Docker, other than repeatable deployment and runtime environments, one of the great benefits promised by the containerisation movement is how it can supplement your local development environment. No longer do you need to simultaneously waste time and slow down your local development machine by installing various services like Redis, Postgres…
Today I had the pleasure of delivering a last minute replacement talk on going cross-platform with ASP.NET Core at BrisTech 2016. The original speaker dropped out just a couple of days before the conference so I was more than happy to step in and deliver the talk. Overall I’m really happy with how it turned out, and considering the talk was a last minute stand-in talk I was really pleased…
This weekend I had the pleasure of speaking in front of this friendly bunch (pictured) at DDD 11, a .NET focused developers’ conference - this year hosted out of Microsoft’s Reading offices. My talk topic? Building Rich client-side applications using Angular 2. As a regular speaker at meet ups and the occasional podcast, this year I’ve been keen to step it up and move into the…
Recently, we were lucky enough to have Steve Sanderson speak at .NET South West , a Bristol based .NET meet up I help organise. His talk was titled SPAs (Single Page Applications) on ASP.NET Core and featured a whole host of impressive tools and APIs he’s been developing at Microsoft, all aimed at aiding developers building single page applications (including Angular, Knockout and React) on…
Recently I once again (for those that remember my last talk with Carl and Richard was about shortcuts and productivity games in Visual Studio ) had the pleasure of talking with Carl Franklin and Richard Campbell on the .NET Rocks Show about the Angular 2 command line interface. With all that’s been happening with Angular 2 it was great to have the opportunity to spend a bit of time talking…
Lately I’ve been working on a piece of middleware that simplifies temporarily or permanently redirecting a URL from one path to another , whilst easily expressing the permanency of the redirect by sending the appropriate 301 or 302 HTTP Status Code to the browser. If you’ve ever re-written a website and had to ensure old, expired URLs didn’t result in 404 errors and lost traffic…
A bit of a short post this week but hopefully one that will save some a bit of googling! Recently I’ve been doing a lot of ASP.NET Core MVC and in one project I’ve been working on I have an admin login area. My first instinct was to create the login section as an Area within the main application project. Creating a login area in the same application would work, but other than sharing…
I’ve always been a fan of customising my IDE or text editor of choice, and one such customisation (and often the first thing I do after installing an editor) is setup my font of choice which has long been Google’s Droid Sans font . Recently however, I was introduced to a rather interesting but delightful looking typeface called Fira Mono that’s been designed by Mozilla…
One of ReSharper’s most powerful features is the sheer number of additional shortcuts it adds to Visual Studio, and out of the arsenal of shortcuts available my most used shortcuts have to be the ones that enable me to modify and manipulate code in as fewer wasted keystrokes as possible. Ultimately, this boils down to the following two shortcuts: 1: Expand/Shrink Selection (CTRL + ALT +…
Lately I’ve been re-developing my blog and moving it to .NET Core MVC. As I’ve been doing this I decided to change authentication methods to take advantage of Google’s OAuth API as I didn’t want the hastle of managing username and passwords. Initially, I started looking at the SimpleAuthentication library - but quickly realised ASP.NET Core already provided support for…
I recently watched a Build 2016 talk by N. Taylor Mullen where Taylor demonstrated the power of ASP.NET Core MVC’s new tag helpers. Whilst I’ve been keeping up to date with the changes and improvements being made to Razor, there were a couple times my jaw dropped as Taylor talked about points that were completely new to me. These points really highlighted how powerful the Razor engine…
Recently, whilst debugging an issue I needed to capture the traffic being sent from my local application to an external RESTful web service. In this instance, I needed to see the contents of a JWT token being passed to the service to verify some of the data. Thankfully, Fiddler by Telerik is just the tool for the job. What is fiddler? Fiddler is a super powerful, free web debugging proxy tool…
So you’ve just finished writing a small .NET library for a one-off project and you pause for a moment and think ” I should stick this on NuGet - others may find this useful! ”. You know what NuGet is and how it works, but having never published a package before you’re unsure what to do and are short on time. If this is the case then hopefully this post will help you out and…
Today, whilst out walking the dog I was listening to an episode of Developer Tea titled “ Learning on the Job ”. As someone that’s always looking for smarter ways of learning, this episode was of particular interest to me. In fact, it got me thinking - what tips would I recommend for learning on the job? I find learning on the job interesting for a few reasons. First of all, you…