After I posted my first video about switch and if statement performance, I received some constructive criticism suggesting I may have oversimplified the problem. They’re right. I did. I presented a trivial case that was going to perform about the same regardless of the scenario. I decided to try this experiment again. This time, I […]
Once compiled, is there a significant difference between if statements and switch statements? I wanted to find out. Thanks to /u/sauce-control, I played with this example in the very awesome sharplab.io tool.
C# subreddit question time again! This time, “Which string comparison method is faster?“ I took a bit of a deep dive to see what each code path does. I decided to compare string.Equals(a, b), string.Equals(b) , ==, and !=. Which one is faster? Which one runs less code? Aside: I have a new YouTube channel […]
Another great question from the C# subreddit. Say you have a foreach loop that looks like the following. Does the function in the foreach iterator get executed each iteration, or is the result cached? There’s two parts to this question as I learned earlier.
Another great question was asked on the C# subreddit about integer vs. floating point division in C#. In the post, the commenter essentially asked why, if they store the result of their division in a float, does the whole calculation produce the “wrong” answer?
This morning I saw a great post on the C# Subreddit – “What is the difference of using auto-properties over properties in C#?” At the start of my career, I was confused about when to use each, and why properties were any better than public fields.
This holiday season, I got to celebrate by having not one, but two back-to-back colds. As pervasive boredom began to set hold, I decided I needed to do something productive with my holidays. Then, my fiancee (yes, I proposed at Christmas and she said YES!) and I were talking about one of her volunteer activities. […]
You may have heard that as of January 14, 2020, Windows 7 will no longer be supported by Microsoft. But what does that mean? I’ve had a lot of friends and family ask, “what should I do?” It’s an interesting question because it depends on a few factors. First, let’s talk about what “End-of-Life” means […]
A list of simple colours. Seems like such a trivial idea, doesn’t it? Recently in one of our apps, we needed a list of colours to differentiate some categorized items. Most of the palette-creating tools on the web give you a palette of 5-6 colours. We needed around 10. Enter Sasha Trubetskoy and his blog […]
My life is filled with embedded computers and tiny components, and I love it. I’ve always had an affinity for underpowered equipment. The limitations force you to become creative. I love working with multi-processor computers, don’t get me wrong. But there is something that fuels my creative drive something fierce when I work with embedded […]