Design Pattern – Observer

C# CONCEPTSAccording to Gang of Four, observer pattern defines dependency b/w two or more objects. So when one object state changes, then all its dependents are notified.Photo by Christina Morillo from PexelsIn other words, a change in one object initiates the notification in another object.Use CaseLet’s take an example of an Instagram celebrity influence who has … Continue reading Design Pattern – Observer

Box Selection – Visual Studio C#

VISUAL STUDIO TIPSEdit multiple lines of code at the same timeTip 1: Box SelectionLet’s take an example of the following class with integer properties and apply box selection to update int to, let's say, double at one shot.public class Test { int x = 10; int y = 20; int z = 30; int l = 40;}Shortcut … Continue reading Box Selection – Visual Studio C#

Linear Search .Net

DATA STRUCTURESSearches particular value within a data structure.Photo by clark Cruz from PexelsBackgroundLinear search checks each element in the list until a match is found or until it reaches the end.Linear Search FunctionConsider the linear function as “LinearSearch(arr,value)”where arr is the array to search inside ofwhere value is the element, we are searching for in array “arr.”OutputReturns … Continue reading Linear Search .Net

Design Pattern – Abstract Factory

C# CONCEPTSAccording to Gang of Four, abstract factory patterns can be assumed as the factory for creating factories.Learning ObjectivesWhat is the abstract factory design pattern?How to write code using the abstract factory design pattern?How to create a factory provider?How to create a client application(from the Main method) that uses factory providerPrerequisitesAbstract factory pattern is purely … Continue reading Design Pattern – Abstract Factory

Design Pattern – Factory Method

C# CONCEPTSAccording to the Gang of Four, the factory method allows the subclass to determine which class object should be created.Photo by Life Of Pix from PexelsLearning ObjectivesWhat is the factory method design pattern?How to write code using the factory method?PrerequisitesBasic knowledge of OOPS concepts.Any programming language knowledge.The article demonstrates the factory method using the C# programming … Continue reading Design Pattern – Factory Method

Strange behavior with JavaScript

JAVASCRIPTThere are numerous occasions where JavaScript behaves strangely.I love the frameworks written on top of javascript but do not prefer to write code in javascript.Please find below cases where javascript behave differently:Scenario 1As shown below, see addition and subtraction.11+1 //12'11'+1 //11111-1 //10'11'-1 //10 //What is hell? right?Scenario 2JavaScript is very loosely concerning data types.let name="Sukhpinder";setTimeout(function(){ … Continue reading Strange behavior with JavaScript

Introduction to C#

C# CONCEPTSC# has been around for quite some period, and it continues to develop, obtaining more enhanced features.Photo by Ann H from PexelsLearning ObjectiveHow to install Visual StudioHow to write your first C# programPrerequisitesThe article is beginner level, so previous coding experience is not required.Getting StartedC# is an object-oriented programming language which allows developers to build … Continue reading Introduction to C#

Safely cast using pattern matching

C# CONCEPTSThe article clarifies the difference between “is” & “as” operators and helps consolidate them into applications as efficiently as possible.Learning ObjectivesHow to use the “is” operatorHow to use the “as” operatorPrerequisitesInstall Visual Studio or Visual Studio Code.Knowledge about basic C# concepts.Getting StartedLet’s use the latter code as an example.Test s = new Test();object c … Continue reading Safely cast using pattern matching

Ignore properties —  C#

C# CONCEPTSLearn how to ignore properties based on numerous measures with System.Text.Json.Learning ObjectivesWhen serializing C# objects to JSON using “System.Text.Json,” all public properties by default serialized. If you don’t want a few of them to appear in the result, there are several options.The article demonstrates how to ignoreIndividual propertiesA null-value propertiesAll read-only propertiesAll null-value propertiesAll default-value … Continue reading Ignore properties —  C#

Safely rename a project folder Visual Studio

VISUAL STUDIO IDEHow to rename one or more projects inside solution explorer in Visual Studio.Photo by Joan Gamell on UnsplashLearning ObjectivesDevelopers encounter lots of difficulties while renaming a project structure in a solution inside Visual Studio.Renaming a project includesFolder renameProject name update in solution explorerNamespace update throughout the project filesPrerequisitesInstall latest visual studio community edition.Summary StepsClose Visual Studio.Rename the … Continue reading Safely rename a project folder Visual Studio