Hi Folks , Hope you all programming geeks are doing good. Today, we will discuss about the basic programming design principles and concepts that everyone should be aware about while developing a software . Well, Software Development ain’t easy. Programming/coding can be a real daunting task if not done in the right way. Hope you guys will like this post . So, without wasting time lets get started . [ i will be using JavaScript in here but you can use whatever language you are comfortable with ! ] In this post, we will discuss about : 1. Classes and Objects 2. Constructors 3. Static Methods 4. Recursion 5. Loops 6. OOPS 7. Libraries/Modules/Packages (All mean the same thing) Classes and Object: A class is a blueprint for creating objects . It has member functions and member variables. And an object is an instance of class . One can access class member functions and variables with the help of object . Constructor : It is a special method that is used to initialize the newly created object and is called just after the memory is allocated by the object. { (name){ .log( + + name); } } p = Person( ); class Person constructor console 'Hello from' ' ' const new 'karan' // Output Hello from karan Static Methods / Static Functions They are indeed one of the most important methods that i use . They belong to the class itself. They can be used without the instance (object) of a class. They don’t modify the behaviour of our class but is very powerful when want to view certain data etc Just add static in-front of a function . Recursion : Recursion is a technique where a function calls itself . Their is a termination condition called the base condition which stops the recursive action . { (){ .log( ); } square(x){ x*x; } factorial(x){ (x== || x== ){ ; } x* .factorial(x ); } available_methods(){ .log( ); } } m = MathematicalOperation; .log(m.square( )); .log(m.factorial( )); MathematicalOperation.available_methods(); class MathematicalOperation constructor console 'Mathmatetical operation class' return if 0 1 return 1 return this -1 static console 'This class has two methods. Square and factorial.' const new // output Mathmatetical operation class console 5 // output 25 console 5 // output 120 // his class has two methods. Square and factorial. Loops : Loops in programming languages is a feature which facilitates the execution of a set of instructions repeatedly while some condition evaluates to true. a = [ , , , , , , , , , ]; ( i a){ .log(i); } j = ; (j < ){ .log(a[j]); j++; } 1 2 3 4 5 6 7 8 9 10 // For of Loop for let of console // While loop let 0 while 10 console OOPS (Object Oriented Design) It is a methodology or paradigm to design a program using classes and objects. Main Components of OOPS are Encapsulation , Abstraction , Inheritance and Polymorphism . Lets look at them closely — Encapsulating every thing about an entity inside a class. ie. Putting functions and data members inside a class. Encapsulation: : Abstraction is a very important concept in oops . It simply means that you are hiding the important things inside the class and provides only the necessary or relevant information that you want to show through a object . (It hides the details of implementation) Abstraction It is a concept where a class acquire properties of a child class . We can extend this child class and use already defined methods that are in the base class / Parent class . The main purpose of inheritance is to provide reusable code and help you achieve DRY Inheritance : { (name,gender){ .name = name; .gender = gender; } getPersonName(){ .name; } getPersonGender(){ .gender; } } { (name){ (name, ); } } { (name){ (name, ); } } m = Male( ); f = Female( ); .log(m.getPersonGender()); .log(m.getPersonName()); .log(f.getPersonGender()); .log(f.getPersonName()); class Person constructor this this return this return this class Male extends Person constructor super "male" class Female extends Person constructor super "female" // creating objects ... const new "karan" const new "Anna" // checking results ... console // male console // karan console // female console // Anna It generally means ability to take many forms . There are generally 2 types of Polymorphism — compile time and run time . Polymorphism: : Function Overloading is an example of compile time polymorphism. Same function name different parameter data types . 1 . Compile time 2. Function Overriding is an example of run time polymorphism . Let’s look at an example. Run time : { print(){ .log( ); } print(){ .log( ); } } override = Overriding(); override.print(); class Overriding console 'this is print function' console 'this will override the above print function' const new // output : this will override the above print function Library / Package / Module (All mean the same thing ): It is just a function or list of functions that are wrapped around or are written for repetitive work . Generally, SDE either worked with libraries or they create their own . Automating the boiler plated code .[ Most Important ]. Every programmer should know how to create a library else he would spent a lot of time in writing same code again and again and again and again …. That’s it for this post. I hope you liked it . Once again, thank you for taking your time and reading this post. Good bye | Take Care | and keep coding