Technology & Me ...

Method Chaining Design Pattern in C# and JavaScript

One of the most commonly used and useful design pattern in programming language is Method Chaining. As the name suggests, it allows you to chain / call multiple functions on the same object consecutively, without any need to specify object name during each method call. This pattern is heavily used in JavaScript libraries like jQuery, AngularJS and in Language Integrated Query [LINQ] feature of C#. In the first part of this article, we will cover how this pattern is implemented in jQuery and C# LINQ. The code snippet presented in the article will help you to understand how this pattern…

Top 10 JavaScript traps for a C# developer

If you are an experienced C# developer, coming into JavaScript world for application development, you will end up making few common mistakes. However some of the mistakes you would make are due to the basic differences between any strongly typed language [C#, Java etc.] and a dynamically typed language [JavaScript, Python etc]. Although dynamic feature was added to C# version 4.0, its initial design was based on static typing. Note, I am primarily a .Net developer and have experience of developing web applications using JavaScript, and I admit that I made these mistakes when I started learning JavaScript. I spent…

How to avoid race condition in C#?

Classes in System.Threading namespace and Task Parallel Library [TPL]  introduced in .Net framework 4.0 helps application developer write concurrent, multithreaded, parallel and asynchronous program. Yes I know; I have used quite a few heavy words here, which are often confusing and difficult to differentiate.  So let’s understand the difference between these terminologies first and then we will drill into race condition and thread / task synchronization. Concurrent – A concurrent system is a one where computation can make progress without waiting for all other computation to complete [extracted from Wikipedia]. However, it’s a generalized term as it does not specify…

Microsoft Intermediate Language [MSIL] Tools

I have been a .Net developer since long time and I have developed fairly complex and large scale applications using different .Net framework technologies like C#, ASP.Net, Windows Forms, WCF etc. I have conducted numerous training sessions on these technologies for my team members and colleagues as well. Most of the time my focus was on to explain the language features like ‘Abstract classes’, ‘Interfaces’, ‘Virtual methods’, ‘LINQ’ etc. However I did not pay much attention on the compiler side. That is, how C# compiler compiles source code, how Intermediate Language [IL] looks like, how can I disassemble the code…

Web Forms, MVC, Single Page App, Web Pages Comparison

ASP.Net is a GREAT platform to build rich, interactive web based application and services. It provides many useful features like authentication, authorization, session handling, HTTP request handling, routing, bundling and minification, friendly URLs etc. You might have seen below diagram in many presentations from Microsoft, which highlights core pieces of ASP.Net web stack. Sites section contains different UI framework options like MVC, Web Page, Web Forms and Single Pages [commonly known as SPA] to build web based application. Services section contains Web API which deals more with data transformation in different formats like XML and JSON and SignalR is used…

1 of 10
12345