C#, Programmers Latrinalia

[C#] Be careful with Path.Combine()!

If you are old enough to have experience in .net framework (and I hope you do, otherwise I will feel really old myself!), there is a high probability that you were concatenating directory paths wrong all the time! And that’s all because some time ago, somebody at Microsoft had, let’s say, not a best idea :P.

Continue Reading

AZ-900 exam – questions & answers (my perspective)

Last week I took the AZ-900 exam and when I wrote about it, I received a few repetitive questions so I decided to write a blog post instead of answering the same questions again and again ;). I’m sorry, I’m lazy.

As an introduction, let me mention that the exam is a test consisting of 42 questions. It covers mostly the basics of Azure.

Continue Reading
C#, Tech

Cannot implicitly convert type ‘Abc<Derived>’ to ‘IAbc<Base>’ – Contravariance vs Covariance – part 2.

Today I will write about the way variance (<in T> and <out T>) influences type checking in C#. Yes, the fact that one type can be passed to a generic method that requires another type, depends on these 2 small keywords we write before ‘T’ (or whatever ?) in interface header. BTW this article is the continuation of my previous post that makes a dummy introduction to the variance – if you haven’t seen it, then you should :P. Not because I wrote anything important there, but because my google analytics statistics will grow. So as you can see – it’s worth it :P.

Continue Reading
C#, Tech

Enumerable.Empty<T>() vs new ‘IEnumerable’<T>() – what’s better?

Reading Microsoft documentation when we have all that stackoverflow questions with answers usually seems a waste of time. And as a typical, lazy programmer I admit that (much too often) I agree with that sentence ?. But today I decided to check how Enumerable.Empty<T>() works and wasn’t satisfied with the knowledge I got. I started digging a little bit deeper and wasted some of the precious beauty-sleep time  so if you want to know what’s happening when you add an element to an empty collection, let me tell you a story of today’s night.
No, not that story, you sick head! Continue Reading