If you’re new to the observability space, it’s easy to get lost in a sea of terms. What are APMs, traces, spans, telemetry, and metrics? Are Jaeger and Zipkin actual words? What’s the difference between OpenTelemetry and OpenTracing? Let’s try to make sense of all this language. Let me present a complete dictionary of observability and distributed tracing terminology. Telemetry refers to the collection of signals that your applications, services, and infrastructure send to observabili...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Once upon a time, I wrote a book about debugging in .NET . After 4 years now, I think it’s time for the old fellow to become available to everyone. PDF | MOBI | ePub + Video lessons Some topics covered in the book are: Advanced debugging techniques with Visual Studio .NET Core and .NET Framework on Windows, Linux, and Mac Performance issues Memory leaks and memory pressure issues ASP.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
When talking about big tech, we usually mean five specific companies known as the Big Five or GAFAM. Those are Google, Amazon, Facebook (now Meta), Apple, and Microsoft. These companies have shaped the technology world as we know it. They led the five big waves of disruption: personal computing, the internet, mobile, social media (web 2.0), and cloud. When we think of personal computers, we think of Microsoft and Apple. When we think of the internet, we think of Google and Amazon.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Changing APIs is a common problem for library authors. There’s some class or function that you need to change, but you don’t want to break your library’s client code when they upgrade the library. In other words, the change needs to be backward compatible. Sure, there are cases when you’ll have to make breaking changes, but it’s usually better to avoid that. In the case of company-internal packages, when you can modify both the library and the app that consumes it, there are a few n...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
We had a ton of stuff go down in the world of C# .NET this year. The big news was all about generative AI, ChatGPT, and Copilot, but the .NET team and the community didn’t take a sabbatical. We had loads of conferences, announcements, new frameworks, and cool tools. There was a fresh C# version release, a new .NET version, and plenty more. Yours truly went over all the 2023 announcements, the most popular conference sessions, the top tool releases, and the most-loved blog posts of the year.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Software companies come in many sizes. There are small startups, medium-sized companies, and huge enterprises. As you might expect, startups are usually lean and fast. Big companies that develop large applications move much more slowly. Those might be systems developed for many years or decades by hundreds of developers. I’m talking about products like the Amazon marketplace, AutoCAD, or any operating system. These products take a very long time to release new features or fix bugs, consider...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
LINQ is one of my favorite features in C#. It just makes the code look nicer. Instead of tedious foreach loops, we got a neat functional syntax that’s easy to write and understand. Well, at least if we’re using the method syntax flavor of LINQ. LINQ is also terrible to debug. We have no way of knowing what goes on inside that query. We can see the input, we can see the output, but that’s about it.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Premature infrastructure is a peculiar behavior pattern that I witnessed in every single tech company I worked for. It is the habit of creating infrastructure code before it is actually needed. The development team is predicting future requirements and preparing ahead of time. That might be preparation for a future feature, extension capabilities that aren’t needed yet, or customization that may or may not be wanted. I believe that creating premature infrastructures is one of the biggest pr...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Do you ever feel like a million tasks are looming over you at any given moment? How about that you can’t concentrate because it feels like you should be doing something more important? I used to have these feelings all the time. I call this “brain clutter”, though I’m sure there are many other names for it. That’s a problem that hurts work productivity more than you might realize. Not to mention your peace of mind.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
The more I work in software development, the more I love working with the command line. I notice I’m becoming increasingly productive with it. When dealing with Git, for example, I used to do almost everything in a GUI program, whereas now I use the command line for 90% of the actions. But the command line will make you more productive with everything, not just source control. There are several reasons why it’s so efficient.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
We all know the value of debugging. Inspecting the values of variables, seeing the call stack, and moving step-by-step are all features that are priceless for developers. But it’s not always simple to get a debugging session going in real-world scenarios. Sometimes, you can’t get the debugger working. Or you’re starting the program from the command line and want to debug from the very start. Perhaps there’s a crash as soon as the app starts.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Steve Jobs was a genius product guy. I think few would say otherwise about the man behind the iPod, iPhone, and iPad. But given a different turn of events, say if he was born 30 years later and decided to become a software engineer, how would he manage? Do you think he’d reach similar greatness as he did in Apple? If you read Steve Job’s biography or saw the movie Jobs , then you’d know Steve had some special personality traits.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I don’t know about you, but I hate using the mouse. The entire concept of a mouse is not productive. I’m supposed to move my hand to a different place, nudge something with accuracy, and click a button. I’m getting tired just thinking about it. I’d argue that unless you’re doing design or graphics, you can get by with just a keyboard. Most certainly as a software developer. Well, an occasional mouse contact might be required to browse a website and whatnot, but you’ll be better of...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
The annual Microsoft Build 2023 conference just occurred and it came with a truckload of announcements. This event is Microsoft’s developer-focused conference, and it’s usually about cloud services and developer platforms. But it’s not unusual for the conference to be used as a marketing opportunity, and this year wasn’t an exception. Microsoft marketed the hell out of Windows, Microsoft 365, and Bing among other products, and it did so with a singular focus on AI.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I don’t think I have to make the point of how important tools are. What would we do without IDEs like Visual Studio? Or without good email clients like Gmail and Outlook? For power users like software engineers, good tools can 10x your productivity. Everyone got their favorite tools, and I think I gathered a pretty good list. So here’s my list of tools that I use every day and highly recommend.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Disclaimer: This blog post was written by a protein-based intelligence. in a previous blog post , I showed you how to use PostgreSQL in C# with Npgsql, Dapper, and Entity Framework Core. But if you’re going to use one of them, it’s probably a good idea to make sure you’re not choosing a library that has really bad performance. Or at least to understand how much it’s going to hurt.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Disclaimer: This blog post was written by a human, with no AI-generated text Have you ever considered the concept of the proof of concept? I bet you’ve been asked more than once in your career to prove something works before committing fully. It could have been anything - a change in UI, a performance optimization, or a new feature. The underlying contract is that if you prove the concept works, you’ll get the resources to develop the new thing.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
One of the most used databases these days is PostgreSQL (aka Postgres). Its accomplishments include being the most popular DB [among professional developers] according to Stack Overflow survey of 2022 , the database in all of the fastest TechEmpower benchmarks , and being the most advanced open source database (self-proclaimed). We’ll talk today about combining Postgres with my favorite language and runtime: C# and .NET. Just because Postgres isn’t a first-party Microsoft database, like S...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Disclaimer: This blog post was written by a human, with no AI-generated text. An application’s code base is a living entity. It keeps growing, changing, and adapting. There’s always a new feature to add, more bugs to solve, and new bugs that are created as a result. As the teams grow, the code changes more often and there are ever more features, more issues, and more bugs. Thorough manual testing becomes impossible the bigger your application gets and as you ship more frequently.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
We continue on our path to make a web application using C# and .NET. After choosing the front-end technology in part 1 , picking the backend server tech in part 2 , and deploying to Azure in part 3 , we’re going to concentrate on choosing the database. With emphasis on .NET and Azure technologies of course. A database, or rather databases, is one of the most important aspects of any big application.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
We have a pretty great ecosystem for C# and .NET. We have amazing IDEs like Visual Studio, a fast runtime, good troubleshooting tools, etc. But I think we can do much better. I think the .NET ecosystem can be somewhat inspired by the development process in JavaScript and TypeScript projects. I’m talking about Visual Studio, MSBuild, and the .NET SDK being a closed ecosystem, whereas in JavaScript there’s an open ecosystem that enables amazing extensibility by the community.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Node.js is probably the most popular backend technology in the industry. Companies like Twitter, LinkedIn, Uber, and many others use Node.js as their primary server technology or combine it with other languages. It has a lot of things going for it like a huge community, a great ecosystem, and it uses the same language in the front end and back end. Since C# and .NET are my main programming languages, I’m trying to figure out if I’m using an underrated technology or if the market trend has...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I’ve been a .NET software developer for my entire career, and I love it. I love the C# language, the productivity of the platform, and the ecosystem. But I’ve been dealing with an existential crisis for years now. I see how companies, especially startups, don’t seem to choose .NET as their platform of choice. That role seems to be reserved to Node.js in recent years [1] [2] [3] . Over the last few years, I got to work with Node.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I don’t know about you, but I’m obsessed with shortcuts. I’m much more productive when using just the keyboard, and having to use the mouse annoys me deeply. Over the years, I’ve learned many useful shortcuts that increase productivity. Many of them are for IDEs or other apps, but some of the best shortcuts are part of the operating system itself. Today we’ll cover 6 amazing shortcuts in Windows 10 and 11 that transformed the way I work and can make you much more productive.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
After 6 years of hosting my blog in WordPress , I ported it to Hugo , a static site generator. I used to be a big WordPress believer. I’d tell anyone who wished to hear, and many who didn’t, that WP was the answer to everything. Whether you’re building a personal blog, an e-commerce site, or a portfolio showcase. That belief was crumbling for the last few years up to the point I turned almost 180 degrees.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
The Best C# .NET Web Application Tech Stack: Deploying to Azure We’re continuing our journey to go over the best modern web technologies by Microsoft for building a web application. We started by choosing a client-side framework in the first blog post and went on to choose a server-side tech in the 2nd post , and now it’s time to actually have your app make its way to the internet. And since our constraint is to use Azure as the cloud provider, we’ll see all the options to deploy and ho...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Did you notice that Microsoft announces a new and amazing web development framework each year? This year we had Minimal API hosting , before that we had Blazor , and before that we had ASP.NET Core . My point is that as the years go by, we get more and more technologies, and it’s getting hard to keep track of them all. In this article series, we’ll go over all the ways to build a web application using Microsoft technologies and try to make some order in the mess.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
There are so many different ways to create a web application today, it’s staggering. We have lots of different languages, different clouds, different server-side runtimes, and different deployment tools. Web assembly complicates things even more now that we can create our front-end in practically any language we want. In this post, we’ll try to make some semblance of order. We’ll go over the most popular technology choices in each layer of web application development, and see their pros...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I had the opportunity to interview Oren Eini , the CEO of RavenDB , a NoSql database created in C#. We had a fascinating talk and you can listen to the full recording here: Oren Eini is a long-time [blogger](https://ayende.com/blog/), a Microsoft MVP, a practitioner of 20 years experience in .NET technologies, author of “Inside RavenDB”, and a keynote speaker. Oren certainly makes a unique impression. Having listened to a lot of CEO interviews in countless podcast episodes, I never encoun...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Everything has its limit, right? A car can drive only so fast, a process can use only so much memory, and a programmer can drink only so much coffee. Our productivity is limited by our resources, but we have the ability to make better or worse use of them. The goal should be to use each of our resources as close to its limit as possible. We want to use every bit of our CPU and memory or else we’re over-paying for expensive machines.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I don’t know about you, but I’ve been battling with performance problems all my career. And I’ll probably keep doing that all the way to retirement. For some reason, perf issues never seem to end. And the bigger the project gets, no matter how much effort your team puts into optimization, the performance problems keep piling up. So I came to accept the point of view that performance problems just mean you’re successful.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
One of the most impressive productivity tools in .NET development is ReSharper . I keep getting blown away by its capabilities with each release. Don’t get me wrong here, I love Visual Studio, and it’s getting immensely better as well. But whenever I think Visual Studio caught up, I discover some new amazing feature that leaves me dependent on ReSharper and Rider yet again. So in this blog post, I’ll tell you about 6 of ReSharper’s more addicting features.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Today’s users expect the best experience possible, and that means top-notch performance. They expect smooth scrolling, immediate interaction responses, fast page load time, and flawless animations. That’s easier said than done. As web applications scale and grow in functionality, it becomes increasingly difficult to know when performance issues appear. Profiling locally to find performance problems is convenient, but gives you very limited information. While things might work well in our ...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I think we can all agree that logs are pretty damn important. Since the beginning of time (well, of software development), logs offered an invaluable service: an insight into the black box that is your program. They can tell a story of the program’s usage, a report of all its errors, and a glimpse of its performance under the hood. Somehow, all the remote debuggers and observability tools in the world weren’t quite able to replace logs.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I recently went through a series of job interviews for some of the biggest companies in tech. Without giving any names, I interviewed for 3 out of the top 5 tech firms in the world. You know who I’m talking about. The interview processes in these companies were quite different from each other, but they also had a lot of things in common, including a big emphasis on coding problems. Those problems might be to sort something, to print all possible combinations, or to find your way out of a maze.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
When you’re using LINQ to work with a database the experience is kind of magical, right?. You treat the database entities like a regular collection, use LINQ operators like Where, Select, or Take, and it just works. But let’s consider whaHere’s how the this functionality can be achieved with dynamic queries and expression trees:t happens under the hood. The LINQ query you wrote transform into SQL (or something else), and that SQL query is sent to the database.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Memory problems in a big .NET application are a silent killer of sorts. Kind of like high blood pressure. You can eat junk food for a long time ignoring it until one day you face a serious problem. In the case of a .NET program, that serious problem can be high memory consumption, major performance issues, and outright crashes. In this post, you’ll see how to keep our application’s blood pressure at healthy levels.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Thanks for confirming your humanity! The sample chapter is available here . For more details on the book and the video series, go to practicaldebugging.net . I’ll send you updates about the book and relevant articles. You can unsubscribe at any time of course. You can reach me for questions about the book and feedback at michael@michaelscodingspot.com or on Twitter at @MichaelShpilt .| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
You’re interested in ASP.NET, Got it! I’ll try to send you emails more relevant to ASP.NET. For now, you might enjoy the following posts: Use Attributes & Middleware in ASP.NET Core for Logging, Telemetry, and Anything Else C# to C# Communication: REST, gRPC and everything in between Debugging ASP.NET Web Request Failures: The Complete Guide| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
You’re interested in C#, Got it! I’ll try to send you emails more relevant to C#. For now, you might enjoy the following posts: C# to C# Communication: REST, gRPC and everything in between C# Features: Innovations or Imitations? – Part 1 The Battle of C# to JSON Serializers in .NET Core 3| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
You’re interested in debugging, Got it! I’ll try to send you emails more relevant to debugging. For now, you might enjoy the following posts: 10 Essential Debugging Tools for C# .NET Development Debugging 3rd Party .NET Code without symbols in Visual Studio Use Performance Counters in .NET to measure Memory, CPU, and Everything – Full Guide| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
You’re interested in .NET memory, Got it! I’ll try to send you emails more relevant to dealing with memory in .NET. For now, you might enjoy the following posts: 5 Techniques to avoid Memory Leaks by Events in C# .NET you should know Use Performance Counters in .NET to measure Memory, CPU, and Everything – Full Guide Demystifying Memory Profilers in C# .NET Part 1: The Principles| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
You’re interested in .NET performance, Got it! I’ll try to send you emails more relevant to dealing with performance. For now, you might enjoy the following posts: Challenging the C# StringBuilder Performance Find, Fix, and Avoid Performance Problems in C# .NET: 10 Best Practices The Battle of C# to JSON Serializers in .NET Core 3| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Please check your inbox to confirm your subscription! The confirmation email might have reached the Promotions / Junk folder.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Every once in a while you need to add meta functionality without actually changing the business logic code. This might be reporting telemetry, logging, or adding metrics. While necessary, writing this code along with the business logic feels kind of wrong. There’s no separation of concerns, it makes the business logic harder to read, and it’s prone to bugs. If you’re using ASP.NET Core, you can use attributes and the middleware system to add this kind of logic.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
About a month ago I released my first book Practical Debugging for .NET Developers . It was a pretty crazy journey and I learned a whole bunch of new things. Besides the actual writing, there are a ton of things involved in publishing a book. There’s the book cover, editing, book formatting, publishing to a marketplace, creating a landing page, and promoting the book. I’ll tell you how I did all those things for better or worse.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I don’t know about you, but reference conflicts in .NET led me to tears multiple times. I like to deal with logical challenges, software design, and performance. Not dependency issues and strange assembly load conflicts. So in my struggles, I came to understand the inner depths of .NET references and lived to write about it. In this article, we’ll talk about what exactly is DLL Hell, how these kinds of problems can occur, and the best ways to dealing with them.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
If you’re like me, then you’re addicted to productivity tools. That’s one of the reasons why I love Visual Studio—it has an endless amount of productivity tricks. This post is going to show five such tricks that help in my work every day. Note that these are with Visual Studio only. There are extensions like ReSharper , Roslynator , and OzCode that add a ton of productivity value, but that’s for another blog post.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
For almost a year now, I’ve been writing a book about debugging and problem-solving in .NET. I’m pretty upset at whoever said writing a book is just like writing a series of blog posts. That was way more work than I signed up for. But it’s over now and my book Practical Debugging for .NET Developers is available . This book is all about solving bugs. I daresay say that the ability to solve difficult problems is what differentiates great engineers from good engineers.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
This article was originally written for the Ozcode blog . There’s a window in Visual Studio that enables you to run and evaluate any code you’d like. That magical windows is the Immediate window. To use it all you need to do is write valid code, such as: System.Console.Write(“Hello”), and presto: The Immediate Window looks pretty straightforward, but it hides some cool features. In this post, I’ll show you five tricks you can use with this window that you absolutely should know if y...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
For better or for worse, a senior .NET developer needs to understand how the .NET runtime loads assemblies. We are constantly dealing with libraries and NuGet packages. These libraries depend on other popular libraries and there are a lot of shared dependencies. With a large enough web of dependencies, you’ll eventually get into conflicts or hard situations. The best way to deal with such issues is to understand how the mechanism works internally.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Memory and performance are tightly coupled to each other in .NET. If you don’t create a “garbage collector friendly” application, you’ll have performance problems. In extreme cases, those problem turn into memory pressure, also known as GC pressure. This situation occurs when the application spends too much time in garbage collection instead of executing application code. In small, or even medium-sized applications, you might not notice this problem at all. You might have an ASP.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
One of the biggest memory-related problems and I daresay all-round problems in .NET, are memory leaks. They are very common, hard to notice, and eventually lead to devastating consequences. These include out-of-memory crashes, high memory consumption, performance issues, and unnecessary “live” objects that keep executing code. The main tool to detect and fix memory leaks is a Memory Profiler. In fact, I believe the most common usage of memory profilers in .| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Memory problems are some of the most important and potentially devastating things in .NET. Even though the applications works on top of a managed environment (the CLR) that includes automatic garbage collection, memory issues didn’t disappear. Far from it. It’s still as important as ever to understand how memory works and how to deal with problems. The two biggest memory-related issues in .NET are memory leaks and memory pressure (aka GC Pressure).| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
This is a guest post written by Roy Green of The Sensor Shack , a free online resource for engineers to learn about different types of industrial sensors for measuring temperature, pressure, flow rate, displacement and more. Arduino boards are a range of low cost open source microcontrollers ideal for DIY projects including robotics, drones and environmental monitoring. Although their processing power and RAM are limited, Arduinos have the advantage of being easy to program (there are many fr...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Back in the distant past, in a simpler time, version releases were very different from today. Each product version release was a huge ceremony. First came a very long period of planning that ended with a specification document. Then, the development of that spec, another long period of manual testing, and when all bugs were finally fixed, the deployment. This process took anywhere from two months to a year to finish.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
When it comes to debugging software, tools are extremely important. Get the right tool and you extract the right information. Get the right information and you can find the root cause of the issue. Find the root cause and you’ve solved the bug. You’re about to see a biased list of what I believe to be the most essential tools to investigate problems in C# .NET. These will help you get to the root cause of any difficult problem and fix it.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
There are many ways to communicate between a C# client and a C# server. Some are robust, others not so much. Some are very fast, others aren’t. It’s important to know the different options so you can decide what’s best for you. This article will go through the most popular technologies today and why they got to be so widely used. We’ll talk about REST, gRPC, and everything in between.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Welcome to michaelscodingspot.com I’m really happy you decided to join. I’ll take care to send you interesting and value packed blog posts. You can reach me for blog post requests, questions, and feedback at michael@michaelscodingspot.com or on Twitter at @MichaelShpilt . Want to read something now? Here are a few of my most popular articles of all time: The Battle of C# to JSON Serializers in .NET Core 3 8 Ways You can Cause Memory Leaks in .| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
You’re sending an HTTP request to your ASP.NET server, and out of the blue, it returns a 500 error. Now what? The error code doesn’t say too much by itself. Did a database request fail? What was the exact database query? Was there an exception? What kind of exception? On which line of code did it happen? And what were the local variables? Wouldn’t it be great if you could see the failure as if you’re breaking on an exception while debugging in Visual Studio?| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
It’s not so rare to see weird things happen in 3rd party library code. Call some method and you’ve got a strange exception. Or an incorrect behavior or even a process crash. Is it a bug? Are you doing something wrong? Is it a configuration problem? It sure would be nice to debug some of these issues. In this article we’re going to do just that – We’re going to see how to debug 3rd party library code in Visual Studio.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
You might have heard about OzCode before. It’s an extension for Visual Studio. Like ReSharper, but with very different functionality. The single purpose of OzCode is to help you debug code and find the root cause of problems. In this blog post, I’m going to tell you about some amazing features in OzCode from my perspective and why you should try it out. Disclaimer – I am an OzCode employee. But this is my personal blog and opinions.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
One of the reasons modern computers are so fast is because of multi-core processors. New CPUs can execute many instructions in parallel. How many? As many as the number of logical CPU cores. This allows us, programmers, to run code in parallel using Threads. While this is great, it presents problems like race conditions and resource access from multiple threads. Locks provide a solution to some of those problems but add a new set of problems like Deadlocks and Lock contention.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Performance issues never seem to disappear from the world, no matter how fast new computers become. To deal with those issues we need proper tools. In the world of .NET development, we can consider ourselves lucky in this regard. We have some of the best tools available, at least on Windows. On .NET Core with Linux, things are not so great. But they’re getting better. With .NET Core 3, Microsoft introduced a bunch of new much-needed diagnostic tools:| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
.NET Core 3 was recently released and brought with it a bunch of innovations. Besides C# 8 and support for WinForms & WPF, the new release added a brand new JSON (de)serializer. This new serializer goes by the name System.Text.Json and as the name suggests, all its classes are in that namespace. This is a big deal. JSON serialization is a big factor in web applications. Most of today’s REST API relies on it.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
There’s an incredible built-in mechanism in Windows called Performance Counters that allows you to follow a whole lot of useful metrics. It’s easy to use, comes free, and perhaps not used as much as it deserves. Here are some of the things you can measure with performance counters: CPU Usage Memory Usage Number of exceptions thrown in a process Number of requests in your ASP.NET application Request response time in your ASP.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
In this 3rd part of the series, we’ll continue our journey to explore multi-threaded pipeline pattern implementations in C#. Let’s do a quick recap of the previous parts: In Part 1 we defined the pipeline pattern and talked of the different implementation types. Then, we saw some hardcore C# trickery to create a very nice pipeline builder with BlockingCollection. In Part 2 I showed how to create similar pipeline implementations with the excellent TPL Dataflow library.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Logging is a big part of software development for many years now. One can argue that a logging mechanism is a must-have part of any application or library. I would agree with that statement. Logging has a crucial part to play in a scenario where you can’t use interactive debugging (that is, attaching a debugger like Visual Studio). It allows us to investigate errors after the problem already happened. In some cases, like Production Debugging, logs might be the only information you have.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
One of the most important concepts in modern programming is Exceptions. They were introduced in the 60’s with LISP and eventually made their way to practically all modern programming languages. The simple concept is this: When some kind of error occurs during runtime, the execution will terminate and an Exception will be thrown. This will cause the stack to unwind until an appropriate Exception Handler is found. It’s a brilliant concept really.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
This tutorial is part of a series: Part 1 – Getting started with Visual Studio Debugging Part 2 – Visual Studio Debugging Tool Windows In the previous tutorial, we saw some of the basics of debugging in Visual Studio. This included Breakpoints, Navigation through code, and Investigating variables with the DataTip and QuickWatch. In this tutorial we will go over all the windows Visual Studio has for debugging.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
In the First Part of the series, we talked about the Pipeline Pattern in programming. Also known as the Pipes and Filters design pattern. The first part showed how to implement a Multi-Threaded pipeline with BlockingCollection. In this part, you’ll see how to implement such a pipeline with TPL Dataflow . In a pipeline, each step accepts an input and produces an output. The output of one step is the input of the next one.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
The Pipeline pattern, also known as the Pipes and Filters design pattern is a powerful tool in programming. The idea is to chain a group of functions in a way that the output of each function is the input the next one. The concept is pretty similar to an assembly line where each step manipulates and prepares the product for the next step. We might have a pipeline that accepts a string, finds the most common word, counts its number of characters, and checks if that number is Odd.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I’ve been developing software for 10 years now. Every now and again I wonder what it is that makes me tick. What’s the element that makes me come to want to go work in the mornings. In other words, what is it that motivates us as software developers? After some serious introspection and discussions with other developers, I’ve gathered a list of 13 items that keep us programmers going. I think I covered most of the important things.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Don’t know about you, but I’m obsessed about performance. When my project has a performance problem, I take it as a personal offense and do not rest until that problem is found. That’s probably not the healthiest attitude, but we’re not here to talk about that. Let’s talk about performance problems. This article will show 10 best practices on dealing with performance problems, starting with when you need to deal with them at all.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
This tutorial is part of a series: Part 1 – Getting started with Visual Studio Debugging Part 2 – Visual Studio Debugging Tool Windows Unfortunately, writing code goes hand in hand with creating bugs. We all cause bugs, it’s one of the inevitable facts of life. This process of solving those bugs is called Debugging. Debugging comes in many forms: Stepping through the code with a debugger, investigating logs, unit testing, profiling, and analyzing dumps.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
In a .NET application, memory and performance are very much linked. Poor memory management can hurt performance in many ways. One such effect is called GC Pressure or Memory Pressure. GC Pressure (garbage collector pressure) is when the GC doesn’t keep up with memory deallocations. When the GC is pressured, it will spend more time garbage collecting, and these collections will come more frequently. When your app spends more time garbage collecting, it spends less time executing code, thus d...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Software Engineering is very different from any other type of engineering. While in mechanical engineering or electrical engineering there’s a definite “right” and “wrong” way of doing things, in software there just isn’t. At least as far as software design is concerned. 10 software engineers can build the same product with completely different architectures, different programming models and different languages, and nobody will be right or wrong. With that mindset, I’d like to t...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
I recently wrote 3 blog posts ([1] [2] [3] ) on different Producer/Consumer (Job Queues) implementations. There are a lot of great different ways to implement Job Queues in C#, but which to choose? Which one is better, faster and more versatile? In this article, I want to get to the point where you can make a confident decision on which implementation to choose. That means checking performance and comparing customization options.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
How many times did you use a desktop application to end up with a frozen unresponsive window? Don’t know about you, but it happened to me more times than I can count. There’s a core issue that causes this problem, and that is a single UI thread. There’s just one thread that can make UI changes, respond to events, and so on. If that thread is stuck in a deadlock , then the application will hang.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Any experienced .NET developer knows that even though .NET applications have a garbage collector, memory leaks occur all the time. It’s not that the garbage collector has bugs, it’s just that there are ways we can (easily) cause memory leaks in a managed language. Memory leaks are sneakily bad creatures. It’s easy to ignore them for a very long time, while they slowly destroy the application. With memory leaks, your memory consumption grows, creating GC pressure and performance problems.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
In Part 1 and Part 2 we went over what are Job Queues, why they are so important and how to implement them with several methods. Some of those methods were thread-pool implementations, BlockingCollection implementations, Reactive Extensions, and System.Threading.Channels. Job Queues are also referred to as the Producer-consumer problem . We’ll be adding jobs to the queue (producing) and handling them (consuming) in a First-In-First-Out (FIFO) order. With some variations.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Let’s consider a simple programming challenge: Summing all elements in a large array. Now it stands to reason that this can be easily optimized by using parallelism. Especially for huge arrays with thousands or millions of elements. It also stands to reason that the processing time with parallelism should take as much as regular time divided by the number of CPU cores. As it turns out, this feat is not that easy to achieve.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
In Part 1 we talked about what are Job Queues in C#, when they should be used and how to implement them. We saw several great implementations using BlockingCollection and the thread-pool. While those are great, it’s worth knowing other implementations. Depending on your needs, another type of solution will suit you better. Luckily, we have a lot of great options with C#. In this article, we’ll see a couple of good ones: Reactive Extensions and System.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Some of the biggest performance problems in almost any .NET application boil down to string operations. They are both very common and by nature pretty expensive. In fact, looking at an average .NET Dump you’ll find that most of the memory is usually taken by strings (I heard about 70%). As you probably know, strings are immutable. So whenever you concatenate strings, a new string object is allocated, populated with content, and eventually garbage collected.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
One of the most powerful tools in programming is the Job Queue. It’s a simple concept that stands in the core of many software solutions. It’s also a pretty interesting programming challenge, especially in a versatile language like C#. Sometimes referred to as the Producer/Consumer pattern, the Job Queue means placing a Job of some kind in a Queue, which will be executed asynchronously in a First-In-First-Out (FIFO) order. The jobs will be Queued (produced) by one entity (thread, process,...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
With a rough estimate of over 3 million .NET developers, creating development tools for them is a huge market. There are several big players that are competing for that income. These companies provide productivity tools, profilers, VS extensions, UI Controls and more. We’ll see which companies are the biggest players, how they fare against each other, how much they earn, and some history on how it came to be. There are many types of tools and solutions around .| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
One of the most useful tools in .NET troubleshooting is Dump Files. This is probably the best tool to debug Crashes and for production-debugging. The expertise to create and investigate dumps well can be a huge asset to any organization. In this article, we’ll see what exactly are dump files, why they are so helpful and how to use them correctly. You will see all the ways to create Dump files, to properly match them with symbols and source files and finally how to debug them to solve the pr...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
LINQ is awesome, right? It’s one of those things everyone loves from first sight. Like smartphones in the early days – you just know it’s right. For this post, I’ll assume you already know LINQ, use it and love it. LINQ comes in two flavors – the Query Syntax and Method Syntax (aka Fluent Syntax). For example, the following is the same: var numbers = Enumerable.Range(1, 100); //1,2,...,100 //query syntax: var query = from n in numbers where n % 3 == 0 select n * 2; //method syntax: ...| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Welcome to the 3rd and final part of the Deadlocks-in-Depth series. In this part, I’ll show you 2 additional techniques to debug deadlocks: Working with Tracepoints and using the notorious WinDbg to automatically detect deadlocks. If you’ve stumbled on this post in an attempt to debug deadlocks, you’re in the right place. But I suggest first reading Part 1 and Part 2 . You will see common deadlock causes, techniques to debug them and the ways to solve them.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
In software, one developer can make a big difference. This is why hiring great engineers is so hard, and why programmer salaries are sky-rocketing. A high-performance software developer is an incredible asset in a team. A company is willing to pay them top dollar, and the competition to hire them is fierce. An efficient high-performance developer is a professional that gets the job done fast and effectively. Someone who has incredible productivity with high quality.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
We’ve all been Junior developers at some point. Do you remember that long ago? I sure do. I remember the excitement when I could make something work. I remember the fear when faced with a task I had no idea how to even start. And I remember how impressed I was the “pro” developers and the bulk of their knowledge. I also remember all the mistakes I made, the wrong approaches I took and all my bad decisions.| Blog posts on .NET Software Development, C#, and Debugging on Michael's Codin...
Finding, Fixing and learning to Avoid Memory Leaks is an important skill. I'll list 8 best practice techniques used by me and senior .NET developers that advised me for this article.| Michael's Coding Spot
C# has been through a lot of change in the last decade. From open-sourcing the language to a new cross-platform framework to yearly releases instead of 3-year iterations. Meanwhile, new languages, new frameworks, and new paradigms have taken off in the software industry, including the rise in popularity of Node.js , TypeScript, Kotlin, Rust, Go, and Python. Through it all, C# and .NET stayed relevant and popular . In this blog post, we’ll glimpse the day-to-day activity and challenges the C...| Michael's Coding Spot
Azure Virtual Machines and App Services are the two basic pillars of Azure cloud services. Both offerings provide a way for you to execute workloads or host your server in the cloud. In both, you pay for some virtual machine in an Azure data center that runs your code. But that’s where the similarities end. One is bare bones infrastructure, whereas the other is a managed platform. One is customizable but hard to manage, whereas the other requires forces you to use the specific tooling and c...| Michael's Coding Spot
Is C# slower than C++? That's a pretty big question. As a junior developer, I was sure that the answer is "Yes, definitely". Now that I'm more experienced, I know that this question is not obvious and even quite complicated.| Michael's Coding Spot
Extension methods are awesome, right? They are probably most widely used in the LINQ feature. But when should we use them? And when shouldn't we? Let's talk guidelines.| Michael's Coding Spot
We'll see two more deadlock types: The notorious UI-Message-Queue Deadlock and the Sync-Context Deadlock (both names coined by me just now). In addition, I'll show you a new debugging technique for deadlocks and multi-threaded scenarios.| Michael's Coding Spot
For me, multi-threading programming is one of the most fun things I do as a developer. It’s fun because it’s hard and challenging. And I get a particular sense satisfaction when solving deadlocks. So today I’m writing on one of my favorite subjects.| Michael's Coding Spot
Mediavine Programmatic Advertising (Ver 1.1) The Website works with Mediavine to manage third-party interest-based advertising appearing on the Website. Mediavine serves content and advertisements when you visit the Website, which may use first and third-party cookies. A cookie is a small text file which is sent to your computer or mobile device (referred to in this policy as a “device”) by the web server so that a website can remember some information about your browsing activity on the ...| Michael's Coding Spot
One of the most commonly used patterns in software development is Caching. It's a simple, yet extremely effective concept. The idea is reuse of results. When performing a heavy operation, we will save the result in said cache| Michael's Coding Spot