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.
3 minutes to read read
How many times as a developer of a site, blog or CMS have you wished to have a custom frontend. There have been cases where a developer would have wished that he could create his own frontend. Also, at times many times, a lot of developers had tried to tweak the site to fit into different mobile screens. The reason is mainly because you are bound by the themes and templates that are tied to the CMS and customizing the provided templates is sometimes even more challenging then creating new ones. Well, it seems now there is a very simple answer to all such questions. Headless CMS.
What is a headless CMS?
A normal CMS system be it wordpress, Joomla or anything that you write from scratch, basically it has more or components as shown in diagram.
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.
< 1 minute to read
Recently my machine got formatted. While re-installing the system, I didn’t installed Visual Studio 2019 first. I tried SQL Server management studio later and then SQL Server. The reason for this particular order was due that the fact more or less the work was targetted more on central SQL Severs and for personal purposes I basically use an instance of Azure and then later delete it.
During the installation of SQL server, i faced a wierd problem which wasted about an hour of mine as the setup runs and then it shows as components not installed. The only error thrown during the installation was “vs shell installation has failed with exit code 1638” which seems a bit weird. Some quick googling thereafter revealed that Microsoft C++ 2017 Redistributible was the problem.
< 1 minute to read
Due to some personal reasons and lack of time, I am thinking of not to blog for something. It has happened again, that site was lost as i dropped the db by mistake, could refer this backup, but several of posts gone (again 🙁 ).
I shall try to put if I find anything useful.
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.
4 minutes to read read
With this tool you can load test any SQL Database hitting a given procedure, with test data from a csv. Some of the salient features are given below. When used with Query Store it can help resolve multiple SQL Performance and Bottleneck issues
- Can hit any SQL Database.
- Dynamic connection check before execution.
- Ability to read test data from CSV (details below)
- Ability to fetch store procedures from database dynamically.
- Support MARS, and both Integrated Security and uid/pw options.
- Provide overall metrics viz: Execution Time, Max, Min
- Provide metrics per execution which can be logged to a file for further analysis.
- Provide detailed logging.
- Automatic Handling for multiple resultsets returned.
Download Link provided at the end of post. If you want to cut the long story short, watch the video ab bottom of this page.
I have been looking in the the QuertStore as provided by the SQL 2016 in all features. So I fired up my SQL Azure db and cracked in code, but i could not see any data in there. First thing i tried out, was to run some queries manually, but no luck. On further analysis get to know that you need to have some significant amount of queries executed for it to give some result. For this i got the idea to build this tool.