Blog posts on .NET Software Development, C#, and Debugging on Michael's Coding Spot
https://michaelscodingspot.com/ (RSS)
Once upon a time, I wrote a book about debugging in .NET . After some 4 years I decided it was time for the old fellow to become available to everyone. PDF | MOBI | ePub 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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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,...
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...
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...
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...
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,...
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...
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...
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...
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...
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...
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,...
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...
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...
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,...
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...
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...
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...
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...
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...
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...
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...
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,...
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...
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,...
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...
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
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
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
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...
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
Please check your inbox to confirm your subscription! The confirmation email might have reached the Promotions / Junk folder.
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...
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,...
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,...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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. Before trying to answer this, here’s another question: “Does it really matter?”. With modern CPUs, development productivity...
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...
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...
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...
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?...
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 –...
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...
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...
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...
.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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
In late 2007, C# 3.0 was released with some of the best features in the language. It was in this version that C# took a huge leap forward, opening a gap between it and its foremost competitor Java. Those features included: LINQ Lambda Expressions Expression trees Anonymous types Extension methods And some others In a way, the C# 3.0 feature...
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...
One of the most commonly used patterns in software development is Caching. It’s a simple, but a very effective concept. The idea is to reuse operation results. When performing a heavy operation, we will save the result in our cache container. The next time that we need that result, we will pull it from the cache container, instead of performing...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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....
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...
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...
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...
In the previous post , we saw some the basics of .NET deadlocks. Including explanation of locks, how to debug deadlocks with the Thread Window and how to fix a deadlock. Well, one specific type of deadlock. Now that we got our bases covered, this part is going to be even more interesting. We’ll see two more deadlock types: The notorious...
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 also get a particular sense of satisfaction when solving deadlocks (you’ll see what I mean). This series will go through understanding deadlocks, show common deadlock types, how to solve them, how to debug them...
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...
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...
Anyone who worked on a big enterprise project knows memory leaks are like rats in a big hotel. You might not notice when there are few of them, but you always have to be on guard in case they overpopulate, break into the kitchen, and poop on everything. Finding, Fixing and learning to Avoid Memory Leaks is an important skill. I’ll list 8 best...
Event registrations in C# (and .NET in general) are the most common cause of memory leaks. At least from my experience. In fact, I saw so much memory leaks from events that seeing += in code immediately makes me suspicious. While events are great, they are also dangerous. Causing a memory leak is very easy with events if you don’t know what to...
In Part 1 and Part 2 we saw how C# formed and evolved along the years, from its inception in 2000 up to C# 6.0 release in 2015. Initially, C# was born as a strictly typed object-oriented language. It was influenced somewhat by Java and Delphi and was even called a Java imitation by James Gosling , the creator of the Java. In later versions, C#...
Desktop application development dominated the software world for many years. However, with the rise of the internet, web applications took over with an incredible pace. When smartphones became popular, mobile applications came to be in huge demand, pushing desktop applications into third place. While the previous statement might be true to...
I’m sure every software engineer with a long career had this dilemma: Should I join a startup or a big corporation? It’s a good question since your professional development, the working conditions, life-work balance, and career development will be very different according to the choice you make. There are many differences between a small company...
While trying to explain to a friend what I actually do all day, I came up with this summary of our conversation: This of course not counting coffee, lunch, and snack breaks.
Office politics always sounds kind of negative, right? Like that bad side effect that you have to suffer in your job. Or like a constant obstacle to any good thing that you can achieve. I don’t think I ever heard someone say “I enjoyed the office politics in that place”. Somehow, when a company surpasses a certain amount of employees (say 30),...
One of the most important things in a good project is naming. You can’t deny it – Good names of Modules, Classes, Methods and Variables can make the difference between a code that’s a joy to read and obscure text. Some names are so bad that every time I see them I get a little jolt of annoyance bordering pain. I mean, I worked so hard to build...
If you’re working on a MEF (Managed Extensibility Framework) application, you’re probably familiar with its ups and down. On the one hand, MEF is a powerful plugin system, that’s a pleasure to work with once you know it well. On the other hand, we all encountered strange failures that originated with MEF. Such failures are a nightmare to debug...
I recently had to create a Roslyn Analyzer that envelopes code in a try/catch statement. This reasoning was to prevent loading errors in any exported MEF component . Here’s the analyzer in action: The analyzer does the following: Adds a Diagnostic that finds a MEF ImportingConstructor with content that’s not entirely wrapped in a try/catch...
In part 1 , we saw how C# has evolved from its inception in 2000 to the C# 3.0 release in 2008. C# did not introduce a revolutionary syntax or even revolutionary features. Instead, C# imitated most of its features from C++, Java, Scala, and several other languages. As is the Microsoft way, C# imitated many things but did it better than original....
Around the year 2000, Microsoft developed the C# language (led by Anders Hejlsberg ). This language, along with the .NET framework had a significant strategic purpose. Microsoft would create a better language tied to Windows, driving customers to the Windows ecosystem and Microsoft products. Perhaps this was part of the notorious Embrace, extend,...
Did you hear about stackshare ? It’s a pretty neat website that I recently discovered. The idea is that you can search for any tech company, and see their technology stack. For example, here is Airbnb’s: So the first interesting thing that came to mind was checking out what the most successful startups are using. I used this list of “successful...
I recently encountered an interesting challenge: How to display a .NET object’s properties in an expandable tree view? This is something we constantly use inside the Visual Studio debugger: The debugger’s data tip control is exactly what I needed. An input would be any .NET object, and the result should be a tree view displaying the object’s...
Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 4: Show a popup Window Part 5: Highlight code in Editor Part 6: Follow a span of code with TrackingSpan Part 7: Insert buttons between text characters with Adornments During the...
Some problems in programming seem to stay and bother us forever. Much like cockroaches, these problems resist technological advancements and increasing human knowledge. One such problem is the infamous DLL Hell (and variations of it). The original DLL hell issue was this: Several applications use a shared DLL file. Then, one of the applications...
Fixing bugs is a huge part of a developer’s job, but not many think or read about the actual process of solving a bug. We sort of go at it intuitively, trusting our own self-developed process. Some of us tend to think of bug solving as the 2nd class citizen in programming. Not our real job, which is writing code, crafting new features and...
Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 4: Show a popup Window Part 5: Highlight code in Editor Part 6: Follow a span of code with TrackingSpan Part 8: Add UI in the indicator margin with Glyphs During the tutorial we are...
Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 4: Show a popup Window Part 5: Highlight code in Editor Part 7: Insert buttons between text characters with Adornments Part 8: Add UI in the indicator margin with Glyphs During the...
I think I spend more time debugging code than writing code, designing software architecture, trying to reproduce bugs and even going to meetings! Debugging is the biggest time consumer we have as developers. As time goes by, I keep learning new tricks that make my debugging more effective. I’ve gathered in this post 7 debugging techniques that I...
Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 4: Show a popup Window part 6: Follow a span of code with TrackingSpan Part 7: Insert buttons between text characters with Adornments Part 8: Add UI in the indicator margin with Glyphs ...
Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 5: Highlight code in Editor part 6: Follow a span of code with TrackingSpan Part 7: Insert buttons between text characters with Adornments Part 8: Add UI in the indicator margin with...
In part 2 of the tutorial we created a simple VS extension with a single Menu item. The extension will eventually be able to add code documentation in a separate file (.cs.cdocs) and view it in a nice Heads-Up display. The tutorial explains every step of the way to build such an extension. For starters, we need the ability to select a piece of...
The previous blog post introduced the wonderful world of Visual Studio extensions. Let’s start and do some coding. During the tutorial we are going to build a VS extensions called CodyDocs and place it on [GitHub](https://github.com/michaelscodingspot/CodyDocs). CodyDocs will save code documentation in a separate file and the extension will allow...
Ever used Resharper , CodeMaid , WebEssentials , OzCode or CodeRush ? Those are pretty incredible tools, right? Ever thought about developing an extensions for yourself and your team? Maybe a little something that edits the very difficult configuration files your company invented? Or how about an extensions that automatically performs a...
In software we have to learn new technologies all the time. I mean, every day there are probably a couple of additional JavaScript frameworks born into the world. The amount of languages, frameworks, 3rd party libraries and tools is staggering. And every place of work uses a unique permutation of those. As developers, we have to stay on top of...
In my previous company, we experienced a reoccurring nightmare. It went something like this: New critical bug arrived from QA: Program suddenly crashed. Reproduces 1 / 10 times. Reproduce steps – unclear. The development team, after realizing they are unable to reproduce the bug on their development machine would claim the bug doesn’t reproduce,...
In WPF we define a UI resource system (mostly in XAML resource dictionaries) which includes colors, templates, icons, styles and so on. Sometimes, we need the ability to change our application’s look and feel dynamically, allowing different Themes or Skins. We might have Shared resources for all Themes and Dynamic resources based on the current...
How the annual review scores are formed in the eyes of managers always fascinated me. I have five years of experience with annual reviews myself, and I was always able to do well on them. As a tech lead, I got to give recommendations and participate in some discussions with managers. I formed a pretty firm and possibly naive point of view on them...
WPF is very dynamic and allows us to use resources in many different ways. We can use Static or Dynamic. We can place all our resources in App.xaml or use merged dictionaries each time. You can see all the approaches and what I think is best practice in my WPF Merged Dictionary problems and solutions post. If you’re new to WPF resources, I...
Did you ever feel like Visual Studio is rebuilding projects every single time, even when there were no changes to the code? We can build, change nothing, build again and there we go… VS is starting a build instead of saying all my projects are up to date. Also, there’s that nagging feeling that even when we do change something, VS is building way...
After working for the last three years with TFS’s classic source control TFVC, I recently moved to a new company and with that, to Git. Before working with Git, I loved working with TFVC. I thought it was great and pretty much the most I can expect from a source control. Git, however, changed the way I work with source control and even the way I...
After a relatively short time looking for a job, I joined my a new company: CodeValue . Specifically, I’m working on the OzCode project (which is awesome). But a bit later on that… First let me tell you a bit about my job hunt experience. Started looking for a job I got my CV ready and very hesitantly started to apply for some jobs. If you ever...
When starting with WPF, I had a hard time realizing when to use converters and just how powerful they can be. I would often create styles with complicated Data Triggers, or abuse my ViewModel instead of doing some simple converter magic. I’ll share with you some converter tips and tricks that make my development easier every day. Tip #1: When...
In my last post . I talked about navigation techniques in MVVM and how I didn’t like them too much. I also talked about learning Asp.NET Core is and how good the navigation / routing system is in there. So, following the pain, I decided to create a lightweight navigation WPF framework similar to the one in Asp.NET Core. We’re still using MVVM,...
Have you ever encountered an over designer? An over designer is a software developer that had some life changing event and became obsessed about architecture. The result being, obsessive decoupling, endless coding of Factories, creating deep (also needless) inheritence hierarchies and various use of design patterns for no good reason. I believe...
Recently I was dealing with a couple of bugs in C# regarding timeout behavior. The solutions were pretty interesting so I decided to share them. Consider these scenarios: We show a dialog to the user with some message. We close the dialog after 15 seconds. However, if the user closes the dialog manually, we have no need to close it at timeout....
In WPF you can do everything in many different ways. It’s not always clear what is better. For example, we got many different ways to reuse a UI component. We can use Templates, User controls, Custom controls, ViewModels with data templates and so on. So which is better? The answer is obvious. Always use user controls! Just kidding 🙂 The answer...
A long time ago, on my first programming job I had a design problem that I couldn’t solve. This problem haunted me. The reason was that it seemed so simple, and yet I couldn’t find a good solution for it. Eventually I did a huge refactor, but instead of solving it correctly I simply changed one problem to another. Recently, years later, in a...
Some time ago I had to do a Theming infrastructure for the application in my company. Our application was pretty big with hundreds or maybe thousands of resources in XAML. Structuring big XAML resource hierarchies with Merged Dictionaries turned to be a big pain. I had to learn all of WPF’s problems the hard way. Don’t repeat my mistakes, read...
Let’s say we want to change the looks of all buttons in our application. We want them to have a black background and text inside to have white foreground. WPF gives us a Style infrastructure to do just this. But, as often happens with WPF, we can achieve this in many different and confusing ways. Let’s make some order out of the chaos. Solution...
I’m a software developer and a blogger based in Israel, working at Microsoft. I blog mostly about .NET, web technology, performance, debugging, and career. The opinions in this blog are my own and don’t represent the company I work for. I also wrote a book about debugging .NET . Among my interests is religious intake of coffee, TV series (which I...
My name is Michael, welcome to my blog. I’m 33, live in Israel, working as a .Net and C++ software developer, interested in everything about programming. I wanted a place to share my bit of knowledge with the community. Keep up with the blog and I hope to get your interest. trigger ga