So back in June 2014, I was invited to try out Google Glass at an event in London. So I made an appointment to go after work on a Friday evening, which worked out rather well because the trains were delayed from Waterloo that day. So I headed off to St Pancras station to find […]
Month: February 2020
Junior Developer Job Hunting Tips
Last year some junior developers which I have worked with in the past asked me for some job hunting tips. I decided to post the advice that I gave them to hopefully help somebody else. Pick Your Target Job The first of the job hunting tips is to pick your target job. There are so […]
Nullable Reference Types
Previous Versions Previously in C#, references have been allowed to be null and they could be de-referenced without null checks. We would then get a NullReferenceException, this happens when we dereference a variable which is set to null. Sometimes we have nulls coming from other parts of the code, which we then discover later when […]
Read-only Auto Properties
In this article I discuss read-only automatic properties. I am going to cover how automatic properties have changed over the releases of C# and along the way show how much more concise the code becomes. Automatic Properties Ever since C# 3.0 came out we had the ability to define automatic properties. Gone were the days […]
String Interpolation
For years we have all used string.Format, it was one of those constructs that I thought “oh wow”, when I first started using the .Net Framework back in 2004. One of my colleagues at the time remarked “Its sweet, isn’t it?”, I guess we were easily amused back then? In C# 6 we saw the […]
nameof Operator
The nameof operator was introduced in C# 6. But before I discuss what the nameof operator is for, I would like to show what life was like before the nameof operator. Life before the nameof operator So back in C# 2, we might have the following code in our constructor: We would have used magic […]
C# Expression Bodied Members
We first saw expression bodied members introduced in C# 6. This introduced the ability to take a single expression method and read-only property and reduce it to a more concise form. Functions For example a single line function can be reduced from this: To the following code below: Read-only Properties A read-only property can be […]
.Net Core – Testing Internal Methods
In the .Net Framework, the approach to unit testing internal methods or types was to add an InternalsVisibleTo attribute into the AssemblyInfo.cs file. For example look at the following line of code below: This all works fine in the .net Framework. However in .Net Core most of the settings in the AssemblyInfo file have moved […]