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

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.

Continue reading

< 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.

Continue reading

< 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.


< 1 minute to read 

BitCoins have been there since around 2009-2010, but, when the recent Ransomware WannaCry hit, people get to know about it and it reached a boom instantly. The prices have almost upped 3 Times in last 2-3 months, and the trend is expected to continue.

I have been compleetly off, because of some personal emergencies, and after a long time putting this video in multi video series is intended to provide users who are completely new with a basic understanding of what bitcoins are and how they work.

Also more to come in next videos is how to buy, sell, trade, create offline wallets and more. So remain connected to get more , learn more.

INFO: Please note the audio is little bad due to my mic not working and forced to use system mic.


4 minutes to read readWith the introduction of OWIN  and self hosting, microsoft has really opened a lot of possible doors for developers and application users. This post is targetted to have an OWIN application hosted in Windows Service. Also we would be configuring the SSL for the Site.

Source code can be accessed at: GitHub

Creating a Windows Services Project

This is pretty straightforward. In visual Studio, Create new project and select Windows Service as project. This will add a project with default Service “Service1”. Rename to whatever the name expected.

Add OwinSelfHost and WebApi2

In the Tools-> Nuget package Manager -> PM console type in the following command to get the WebApi and self host packages referenced.

Install-Package Microsoft.Aspnet.WebApi.OwinSelfHost

This will install and reference all the required packages and dependencies. Also we need one more package to debug and use some functions like welcome package. For this import the  Microsoft.Owin.Diagnostics using PM Console.

Install-Package Microsoft.Owin.Diagnostics

Also, to Enable Cross Origing Resource Sharing, we need to import the following package:

Install-Package Microsoft.Owin.Cors

At this point the we are Good to Start.

Continue reading

3 minutes to read read

NLog Targets

The beauty of NLog is the Targets ‘system’ that is extentible and easy to use. Also the most amazing thing is the default target list as provided by NLog and the ease with which custom targets can be written. The Targets provided by the Nlog ¬†by default are more then sufficient for most needs.

There can be multiple targets that can be linked to multiple Rules.

Well, the currently provided targets as provided by NLog can be accessed here. Some of the most useful targets with sample configuration is as below:

  1. ColoredConsole: This target adds a ‘beautiful’ Colored logs on the console. Well from the name it applies for Console Applications only.
    <targets  async="true">
       <target name="ConsoleTarget"  xsi:type="ColoredConsole"  layout="${longdate}, ${level}, ${message}"  useDefaultRowHighlightingRules="true"/>
  2. File Target: The file target as form the names writes the log to any file. Also, the location of the file could be on the network path as well.
        <targets  async="true">
          <target name="ConsoleTarget"  xsi:type="ColoredConsole"  layout="${longdate}, ${level}, ${message}"  useDefaultRowHighlightingRules="true"/>
          <target name="fileTarget"  xsi:type="File"  layout="${longdate}, ${level}, ${message}"               fileName="c:\temp\dummyLog_${longdate}.txt" />
          <target name="networkFilePath"  xsi:type="File"  layout="${longdate}, ${level}, ${message}"               fileName="\\\Shared\temp\dummyLog_${machinename}.txt" />

    There are two targets as defined above, one is normal file in local system and the other one is on network path. The archival options availabel for Files can be seen here
    There is also an possiblity to add more advanced options to control file parameters. An example code is given below as:

        <targets  async="true">
          <target name="adavancedFileTarget"  
                  layout="${longdate}, ${level}, ${message}"               
                  createDirs="true" />
  3. Debug Target: As the name suggests it writes to the Log sink for the attached debugger  (if any :))
        <targets  async="true">
          <target name="debugTarget"  xsi:type="Debugger" layout="${longdate}, ${level}, ${message}" />
  4. Trace Target:  This also as prev, send the messages to system.Diagnoistics.Trace Listener. This can be useful, if there are any existing trace listeners, and nlog is to be configured to integrate with them.
        <targets  async="true">
          <target name="traceTarget"  xsi:type="Trace" layout="${longdate}, ${level}, ${message}" />

Continue reading