Do you REALLY know what SOLID principles means? Think again! (Part 2: O)

open closed principle

Open for Extension, Closed for Modification Classes should be open for extension, but closed for modification. By doing so, we stop ourselves from modifying existing code and causing potential new bugs. What Open Close Principle wants to say is – We should be able to add new functionality without touching the existing code for the … Read more

Do you REALLY know what SOLID means? (#1: Single Responsibility Principle)

Single Responsibility Principle

Single Responsibility Principle: Do one thing and do it well!This principle states that a class should only have one responsibility. Furthermore, it should only have one reason to change. SRP, like most principles out there, can be over-applied. If we create a new class for incrementing integers, then yeah, that may be a single responsibility, … Read more

A Simple Guide To ASP.NET routing – let’s redirect!

redirect

Redirect relates to the routing In ASP.NET. There are two different ways to routing; or changing the current requests endpoint: Rewrite the current URL andRedirect to an external URL. These two tasks are similar but yet different in their execution. Rewriting: Rewriting changes the current request’s path and continues processing the current request with all … Read more

Rest and Spread – Things you can do with just 3 dots in Modern JavaScript!

three dots

Before diving into rest and spread; let’s have some background info. What do you think the output for the above code? Yes, you guessed it right. JavaScript will not throw any error when we call a parameter-less function with any number of parameter and it will output ‘no issues‘. As such; the following code is … Read more

JavaScript Generators Magic and Their Use Case: Everything Yield Need To Know

javascript

JavaScript generators is an amazing and brilliant concept; yet it’s very confusing when to use them. They let us write infinite loops that terminate. The yield values from functions before they finish and build lazy data structures. The magic lies in the ability of generators functions to be paused and then resumed again. But before … Read more