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 the code base calls for the IoC-container to resolve a dependency of an object – he uses a Service Locator anti-pattern. Mark provides the following example: [code language=”csharp”] public class OrderProcessor : [...]

By |2017-09-13T08:48:13+03:00October 27th, 2015|.NET, Best Practices, CodeProject, Design, Refactoring|4 Comments

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 part. But I feel I need to address comments of readers firstly. […]

By |2019-01-11T11:17:52+03:00October 2nd, 2015|Best Practices, C#, CodeProject, Design|2 Comments

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 to avoid exception handling like this: [code language=”csharp”] try { //do something } catch(Exception ex) { } [/code] Well, indeed, I agree that this exception handler looks pretty bad. But is it [...]

By |2016-07-27T17:38:53+03:00September 21st, 2015|.NET, Best Practices, C#, CodeProject, Design|3 Comments

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 Bob’s blog post “Make the Magic go away” convinced me that it’s time to play a little bit at a low level. At first I was thinking about reading a book on [...]

By |2016-04-27T11:16:12+03:00August 29th, 2015|Fundamentals|0 Comments

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 to talk about you can imagine the following case: “Your code makes a call to the third-party library’s method and you have to wait that method until the end. That method performs [...]

By |2016-04-26T18:47:45+03:00August 22nd, 2015|.NET, C#, CodeProject, Multithreading|0 Comments

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 by its inventor, Tony Hoare, as a billion-dollar mistake. Despite of some “modern” practices like making classes immutable, applying Null-Object pattern or using Code Contracts extensively, we still often want to declare [...]

By |2019-01-11T11:18:25+03:00August 8th, 2015|.NET, Best Practices, C#, CodeProject, Design, Refactoring|0 Comments

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 an essential thing for a programmer, in case he wants to be successful. Well, a programmer can succeed without blogging, but it can make the road much easier and pleasant (though, it [...]

By |2016-04-26T16:27:35+03:00July 26th, 2015|Miscellaneous|0 Comments

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. Either I got this knowledge from the “Complete Code” or “Clean Code” – it’s hard to recall. Actually, it does not matter so much. We all know that we should split the [...]

By |2016-08-17T13:54:50+03:00July 20th, 2015|.NET, Best Practices, C#, CodeProject, Design, Refactoring|0 Comments

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 book is extremely easy to read, it’s full of valuable advices and it’s extremely practical. And from time to time it’s fun. There are many interesting sections in the book, but today [...]

By |2016-04-27T11:13:41+03:00July 12th, 2015|Miscellaneous|2 Comments
Go to Top