How do you feel when you invite your friend for a private family function and he brings along a dozen strangers (his friends) ? Entourage Anti-Pattern This is similar to the scenario when you want to add a library as reference and in turn ends up referring a different set of libraries which you … Continue reading Stairway Pattern
Month: April 2018
CLSCompliant Attribute
While developing a library in .Net which could be used by another programming language than it was originally designed in, it is important to remember that the .Net Languages offers a subset of CLR/CTS while offering a superset of CLS. And, if you want to develop a library that could be used by any programming … Continue reading CLSCompliant Attribute
Type Casting using Span<T>
In an earlier post, we explored the possibilities of Span and performance benefits of the feature was clearly visible in our benchmark tests. We will continue exploring the Span further in this post, as attempt to cast between types using Span. The cast functionality is not that hard, thanks to the extension methods that comes … Continue reading Type Casting using Span<T>
Deconstructing Non-Tuples
The 'Tuple evolution' in C# 7x has created increased possibilities of C# like never before, both in terms of performance as well as readability. One of the nicest feature that came along has been the Deconstruction of tuples. Deconstructing Tuples The tuple data structure allows us to bundle together a finite number of values without … Continue reading Deconstructing Non-Tuples
Git stash
Git is arguably the most versatile version control system around and one cannot resist falling in love with this awesome piece of code every time you use it. One of the lesser known features in Git, especially for individual developers/teams who have recently migrated from other tools is the "stash" command. You might often find … Continue reading Git stash
Looking back at DRY
Continuing with our series to bring together the common design patterns and principles, we will, in this particular post, look into arguably the most famous design principle known to programmers - DRY. Don't Repeat Yourselves - or DRY, is possibly the easiest to practice, at the same time, one that could go wrong in the … Continue reading Looking back at DRY
A Closer look at DateTime Operations
There are many ways you could round off a DateTime to the nearest Hour. You could create a new Instance of DateTime, ignoring the current instance's Minute/Seconds parts. You could also use the Add Minute method as seen in the following code. Constructor Vs Add Method But which of the two is more efficient ? … Continue reading A Closer look at DateTime Operations
Zero Bug Bounce (ZBB)
ZBB or Zero Bug Bounce is a defect management technique originating from Microsoft that represents the moment (would prefer to call it a milestone) in time when the developers has managed to fix (or triaged) all the bugs reported by the QA team. The bounce refers to the fact the QA team might (and surely … Continue reading Zero Bug Bounce (ZBB)
Unit Testing Asynchronous Code
Unit Testing Asynchronous methods in older days were pretty tough, but thanks to the advances made in the Unit Testing Frameworks, this is now all the more easier. We will begin by writing an async method, which we could use for writing our Unit Tests against. The advancements in Unit Testing Framework has made it … Continue reading Unit Testing Asynchronous Code
Design Patterns : Bridge Pattern
The essence of Bridge Pattern lies in the fact that it not just decouples the abstraction from implementation, but in doing so, allows both to evolve independently. Let's consider the examples of smartphones. The underlying OS (for sake of example, let's assume its Android) improving every year. The Android has seen atleast 7 versions in … Continue reading Design Patterns : Bridge Pattern