Categories
Programming

Notifications for Web Apps

Although it has been abused with an enthusiasm that borders on the insane, there are good reasons to use the Notifications API in your web apps. For example, you write a mail client that allows the user to request notifications for key contacts… if they are browsing your web-based app, they should get notifications. To […]

Categories
Programming

IISExpress.exe Exited With Access Violation

I was happily typing away at some ASP.NET Core controllers and views, calling a view component to render out some paging links, when this happened… The program iisexpress.exe’ has exited with code -1073741819 (0xc0000005) ‘Access violation’. No exception visible in Visual Studio. No indication of where the error was. Nothing. The Internet supplied links to […]

Categories
Programming

The Software Punk Revolution

Let’s be honest. Our planet is churning out supercodemonsters at an alarming rate. These pinnacles of virtuosity are idols to the false gods of development ego. The pattern has always been there, but in the past it was misdirected enthusiasm. On day one you’d learn how to extend prototypes in JavaScript. On day two, everything […]

Categories
Programming

C# 9 Covariant Return Types

Just a quick note on a neat feature in C# 9 that will allow sub-classes to return a covariant return type… what?! Okay, it allows you to return a more specific, or narrower type. For example, we used to have to return the same type… // parent class… public virtual Literature GetLiterature(…) { return new […]

Categories
Programming Windows

Turn an Old Phone into a Programmable Keyboard

It seems like everyone has a high-quality, expensive, programmable deck on their desk these days. Elgato’s Stream Deck, with it’s glowing LCD buttons, comes in flavours that cost between £100 and £200 (depending on how many buttons you want). It’s beautiful bit of kit that glows its way into the hearts of tech geeks everywhere. […]

Categories
Programming

C# 9 Non-Null Parameters

This neat C# 9 feature can be summed up in a tiny snippet of code. You know that code analysis warning that tells you that the argument passed might be null… wouldn’t it be nice if you could refuse to accept null? Well, you can. This is the before… public Book(string firstName, string lastName) And […]

Categories
Programming

C# 9 Record Types

Update! Since this article was published, it is almost certain that the keyword for record types will actually be record not data as it was in this early preview. We have taken a quick look at C# 9 Initializers and Immutability and C# 9 Non-Destructive Mutation. Let’s now look at the full transformation from an […]

Categories
Programming

C# 9 Non-Destructive Mutation

There are some phrases in programming that feel like they belong in a superhero movie. Non-destructive mutation is just such as phrase. It refers to a concept in functional programming that means when you want to change the state of an object, you create a copy with the change – rather than changing the original. […]

Categories
Programming

C# 9 Initializers and Immutability

There is currently a compromise in C# that means you can enable object initialization with getters and setters, or you can prevent external code mutating state by hiding the setter… but not both. C# 9 gives us both with the init keyword. Let’s look at before… public class Book { public string Author { get; […]

Categories
Programming

C# 9 Simplified Console Apps

At Microsoft Build 2020, an interesting new “see less boilerplate” feature from C# 9 was demonstrated. It removes all the code to create the class and static Main method, letting you just start typing your code. It makes your code way-less-nested (okay, two levels), but doesn’t miss any of your usual features. For example, args […]