Master the Art of Writing Clean Code in C#

Foundations of building object-oriented infrastructures Despite the fact that C# is a very rich on features language, it's very common to see poorly designed and implemented types in a real world. In fact, C# is one of the richest on features language among object-oriented languages in the world nowadays. But with great power comes great responsibility. It's challenging to use all those features in a right [...]

By |2018-11-12T00:15:56+03:00July 25th, 2018|Refactoring, Video Courses, .NET, Best Practices, C#|0 Comments

Handling Errors and Exceptions in C#. Part 3

This is the third and most comprehensive part about handling errors and exceptions in C#. Here are the first and the second part. Also, you can take a look at the blog post about global exceptions handling in WPF applications. Errors Handling and many other topics you’ll find in my new video course “API in C#: The Best Practices of Design and Implementation”. Take [...]

By |2019-01-11T11:14:50+03:00October 24th, 2016|.NET, Best Practices, C#, CodeProject, Refactoring|7 Comments

Designing and Implementing API in C#

Nowadays I’m writing my new programming video course. I chose an interesting topic for the next course: “Designing and Implementing API in C#”. How to design API? In this course, you’ll learn how to design and implement types in C# so that the other developers won’t hate you when using one of the types developed by you. It means you are going to learn [...]

By |2016-07-23T15:47:19+03:00July 22nd, 2016|Video Courses, .NET, Best Practices, C#, Design, Refactoring|1 Comment

Money Type as Value Object, or Don’t Rely on Primitive Types!

Primitive Types Obsession Problem Today I’m going to discuss the problem of using primitive types instead of abstractions. This problem was discussed in the blog of Mark Seemann. Read it, if you haven’t read it yet. In this post I’m going to talk about Money type as an abstraction instead of using decimal type for representing money-values. In the last project I’ve been participating [...]

By |2016-04-26T16:35:43+03:00March 17th, 2016|.NET, Best Practices, C#, Design, Refactoring|0 Comments

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

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|C#, CodeProject, Design, Refactoring, .NET, Best Practices|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
Go to Top