Author: Thanos

  • How to copy a file and report progress in C# using P/Invoke

    10 minutes

    One of the main missing APIs in the .NET Base Class Library is the ability to report progress while copying a large file. We do have the File.Copy and FileInfo.CopyTo methods but there’s no way to report how much data has been copied. Even worse, these methods are not asynchronous, meaning that the calling thread…

  • 🌴How to Convert Any Object to a Dictionary Using Expression Trees in C#

    14 minutes

    In the previous article we explained Expression Trees, what they are and how to use them. In this article we will utilize them to solve a real-world problem that usually comes up in applications where object inspection is required. 🤔The problem There are occasions in your applications where you wish you could treat an object…

  • 🌳 C# Expression Trees: Intro, Construct, Execute, Analyze

    8 minutes

    Learn how to construct, execute, and analyse Expression Trees. This guide provides a complete introduction and key takeaways for developers.

  • ⌨️ Every Developer Should Use Keyboard Shortcuts — Here’s Why

    6 minutes

    Memorising keyboard shortcuts is something like an investment. You spend time in the beginning memorising the shortcuts, but that time pays off later when you start using them. When you realise that instead of searching for a command in the menus, you simply call the action with your fingers. But it’s more than just time. It’s about reducing context…

  • The essentials of the Aggregate method

    4 minutes

    The Aggregate method combines a sequence of elements into a single value. It does that by iterating over each one of them and calling a lambda function. This lambda function produces a result and carries it on to the next iteration. The simplest form The following example calculates the sum of some numbers: In comparison,…

  • Tips For Making C# More Readable

    13 minutes

    “Code is read far more than it is written.” This proverb seems to echo in my head more often than not when I open Visual Studio to investigate a bug. Writing code is easier than reading it. I always thought of reading code as something like reading someone’s mind; you’re following their thought processes as…

  • ❓Stop Asking ‘Is C# Compiled or Interpreted?’ — Here’s Why

    3 minutes

    Is C# compiled or interpreted? This is a question that comes up very often in interviews involving C# and .NET. And in my opinion, it is the wrong question. An interviewer is asking a potential candidate this question in order to trick them into giving the wrong answer. Let me explain. The Problem Because, if…

  • Hello Inquisitive Devs!

    1 minute

    My name is Thanos – yes, that’s my real name 😀 – and I’m a software developer based in the UK. In this blog, I share my stories about code, the lessons I’ve learned through my years in the industry, and anything else that sparks my curiosity. I use C# and Azure, and occasionally I…