3 minutes to read read

Microsoft SQL Server brought some major enhancements recently one of them was native support for Temporal Design “out of the box”. Temporal Design can sometime be challenging. I have personally spent months writing a Custom Middleware layer for Temporal Support since client had explicit requirements for auditability. And believe me, it was not easy.

Realizing the potential of the feature, soon after Entity Framework Team jump into the bandwagon and we had a fully functional Temporal Design purely “as a code” that can be used directly. Also, the features include querying point in time (and other similar operations) out of the box which are very handy. Some of the major advantages are pointed out below.

Continue reading

4 minutes to read read

Around four years ago when .Net Core was in its early stages, I wrote back a Configuration provider for .net core 1.x. This has been a long time. The package did picked up very well and there were multiple downloads and a few queries as well. Many people would never know that .net core started with json project files. But since then a lot changed and my package went obsolete.

A few days back got some time and bandwidth and wised to revise the package. This would not only update the latest package but would also help me understand what changes have been done as in framework as a whole. So, my fellow countrymen let me present you the MongoDbConfiguration Provider for .net Core (😁) /s

Read on further to get the details as I explain the “simple” steps to write a custom configuration provider for .net core 3.1.

Continue reading

5 minutes to read read

With the advent of .Net Core, web Api have become more common. Apologies to my non-dotnet background friends, but with .net hands-on, its always inclined towards .net. Coming straight to the point, be it Mobile Apps, SPAs (Single Page Applications), micro-services or name whatever, you will see REST everywhere. In background of this post, old kishore kumar songs are running, so don’t offend a bit of nostalgia 😊.

But as in most cases, everyone is so busy in implementing the APIs, many of my friends don’t ever pay attention on how an API be named. Or rather, not an API but the endpoints and methods (hate to call them methods). Well, for an API the problem there is no standard as such, but rather some best practices, that should be followed ‘ideally’. Lets discuss them one by one. Most importantly, in this post shall be talking only on the API naming. I also had OpenApi in mind, but lets leave it for another post. So lets dive in.

Continue reading

4 minutes to read read

Working with several customers over the past years, one of the NFR being enforced by customers is Code Coverage, some customers push for 80% while some others ask for 90%. Even had a client which asks for 95% in older days. Also, there is significant cost and effort involved with increasing coverage compliance. And once the said coverage is achieved, its assumed the code is good and safe. Testability of code is a whole story alltogether that deserves a post separately, this post targets more of coverage part.

Offcourse 100% is something next to impossible and thats what nobody dares it to ask or enforce. And this gives a margin for 5 or 10% or even 20% and here comes the problem set of problems. Lets deep dive in, consider the following code.

Continue reading

5 minutes to read read

Clean Code is something which seems so simple by names and most of the times something which is ignored and forgiven by most programmers of all ages, but it is one of the most important characteristic of maintainable code. You may be a top shot programmer highly skilled in structures and algos, but if it is not clean, it may end up as junk. Clean code is something which wraps all (yes all) the aspects of modern programming such as various Design patterns, principles etc. But yet, a lot of people forget (or rather ignore). Lets try to understand what it is, and why is it important. For the most part of the code I shall refer c# in this post, but this applies in general to any language, as its a paradigm to general coding practices not specific to any language.
Disclaimer: Also, this post may get a little longer and may seem a bit boring, but i would highly recommend reading it. Also, most of the content is what i learned by experience, suggestions and/or comments are welcome.

Brief summary of programmers life

I am in programming for about 15 years, initially as a freelancer, and for about last 10 years, working full time. Have been involved in code reviews and refactoring at multiple levels for about last 6 years or so. Also, i have been following several open source projects and also contributing in my part time. Basically in this post, some of the common issues I found across platforms are highlighted along with why are they important.

Continue reading

3 minutes to read read

Journey of Dependency Injection

Asp.Net Core is one of the gems (I would say) created by Microsoft that has simplified a lot of things and provides a whole lot of things by default out of the box. It based on dot net core which provides inherent capability to run cross platform but to ease out developer life several optimizations were done to enhance productivity.

One such feature is Dependency Injection. Although lately, but Microsoft did included dependency injection as a part of the core product. I have been working Asp.Net MVC since 2010 (or 2011) and started DI with Ninject which was (or is) a wonderful project. During the time I crossed paths with Unity and Autofac during different projects, but more or less the approach remain same. Create a container system, create ‘sort of’ controller factories and then register dependencies. But during all this time one thing that remain constant was additional overhead of creating this shit. So it was a moment of joy (atleast for me) when i say this in recent versions of MVC. And most importantly it is quite stable and performs well out of the box.

Continue reading

6 minutes to read read

Async Await is one of the best feature that has changed a lot of dynamics in the recent past, but it has created same amount confusion and chaos. Lot of bad practices, wrong usage has plagued the very usage. I have refactored a very huge WPF code with lots of out ref and reference based codebase to new pattern, on covering ~80% of it, faced a few challenges reverted back. Then after a month took the task again and completed migration.

I do receive a lot of issues in PRs around this. Based on this feeling that there would be many others who are facing such isssue, this post is more targetted from experiences. There could be log of posts and videos and shit load of resources, but I would try to write it concisely and in simple language/. Again, comments are open for discussion.

Continue reading