Blog
When Method Is Better Than Property?
That’s a well known question. Actually, I knew the difference between methods and properties long ago. Despite of that, recently I stumbled upon my own incorrect choice between those semantic constructions. That’s [...]
Classical Algorithms. Are They That Simple?
Sometimes we think that a certain thing is simple, but in the end it appears it’s not as simple as we have thought. I mean, BinarySearch is pretty [...]
Make Your Asynchronous C# Code Cancellable
When I was a newcomer I faced with a chunk of long-running code that didn’t support cancellation. I needed to cancel it somehow. Unfortunately, I had no access to that code, so I couldn’t modify it. I was struggling with the requirement to be able to cancel that code. I was thinking about the problem for two days as I remember and I couldn’t believe that it’s actually not possible to cancel random code. Yes, there is the Thread.Abort method presented since .NET 1, but it’s strongly not recommended to use it, because we can’t predict what will happen to the code which is going to be aborted. It’s even almost (or absolutely) impossible to write code which is reliable in case it is aborted by Thread.Abort, because it’s even not guaranteed that your finally-blocks will be executed. One will say that I’m talking about self-evident things, but I’ve heard many times from developers exclamations like, “why we can’t simply use Thread.Abort in order to interrupt that function?” That’s why I decided to write this post, showing how simple it is to write cancellable code.
Hidden Dependencies as a Smell
Mark Seemann has written a nice post “Service Locator violates encapsulation”. The name of the post speaks for itself that it’s about a pattern (anti-pattern) named Service Locator. When a programmer arbitrarily inside [...]
Handling Errors and Exceptions. Part 2 – Discussion.
The previous blog post received many comments, and this approves that the problem of handling errors\exceptions is palpitating. I thought I’m going to address practical points of errors\exceptions handling in the second [...]
Handling Exceptions and Errors. Part 1 – Intro.
In this article we will discuss exception handling best practices. There is a lack of meaningful information about exception handling on the Internet, so let’s go. Have you ever seen that recommendation [...]
Assembler and the Beginning of Low-Level Programming. Part 1.
I’ve always been interested in how things work under the hood. Unfortunately, computer science courses I’ve taken in the university haven’t covered low-level details of how a computer works. And the last Uncle [...]
UpdateableSpin Synchronization Primitive
Today we are going to look at a relatively rare case of synchronization. There are no appropriate C# synchronization primitives out of the box. In order to understand the case we’re going [...]
Null-Checking Semantics Obscurity
This topic is going to be simple, yet an interesting one. I’ll try to expose here my feelings about a certain case of null-checking. It’s a well-known fact that introducing null-values considered [...]
Blogging. How to do it properly?
As I mentioned earlier, I’ve been reading a book of John Sonmez “Soft Skills: The software developer’s life manual”. Speaking about the programmer’s career, John said that leading a personal blog is [...]
Refactoring: Extract a Method, When It’s Meaningful
Big Functions Hell Well, now it’s hard to remember the moment, when I first time realized that it’s actually a good idea to extract functions from the massive chunks of useful code. [...]
GTD by John Sonmez
I almost finished reading a book written by John Sonmez (popular blogger, software developer and author of many pluralsight courses) “Soft Skills: The software developer’s life manual”. I should say that this [...]