Object Oriented Programming (OOP) is a Programming Paradigm which is based on the concept of objects. Objects are entities that contain Data and Methods. Data refers to the values, variables or state that are used within the program and Method are the Procedures or Functions which manipulate that data.
In OOP, a computer program implements logic by making use of these objects that interact with each other. For this purpose multiple objects of similar or distinct structure are created within the program. Implementing similar objects again and again can consume time and creates redundancy in code. Class provides a solution…
In a computer program, control flow is the order in which set instructions are executed. A control flow statement changes program flow, to achieve specific results, by choosing a path from available paths. These statements can be based on some condition; executing instructions only when some condition is met; or can be unconditional; arbitrarily transferring the flow to some different instruction set. The goto statement was the most basic form of unconditional transfer. It transfers the control to the labelled instructions set.
Procedural Programming is an Imperative style of Programming Paradigm. It is a style of writing computer programs using procedures. Procedural Programming solves a problem by implementing and making use of various procedures.
Procedure is a sequence of computer instructions for performing a specific task. When we need to perform that same task again somewhere else then instead of writing the same instruction set again, we will call the procedure to perform the task. Procedure are also referred to as Routines, Subroutines and Functions. Procedures enable Modularity in a computer program. Procedure may have input arguments in order to perform given…
Functions in general, applies computation on given input and returns the output. It relates input to an output.
f(x) = x + 2;f(1) = 1 + 2 = 3;
f(2) = 2 + 2 = 4;
Above mentioned is a simple function that adds
2 to the input value and returns output. It relates value
[1,2] => [3,4]. Similarly, a function in computer programming is a block of instruction that performs computation on given input and returns the output.
Functional Programming is such a style of…
A program is a set of instructions that instruct the computer to perform a certain task. And Programming Paradigm are the styles of writing a computer program. Paradigms can be broadly classified into Imperative and Declarative programming based on how and what the computer is instructed to do.
Yes. An imperative program tells the computer about how to perform certain tasks. While a declarative program tells the computer about what to do and not really caring about how the computer does it.
Let’s imagine you are into shopping. You want to buy a T-Shirt. In your head you will have…
Paradigms are patterns. We found patterns in every phase of our day to day environment. Whether it be eating, drinking, sleeping or any other part of our life, patterns will always be a part of it. Hence a pattern can be termed as something, a philosophy, idea, theory or method through which we approach certain actions. The same is the case around with programming.
Programming Paradigms are the certain set of constructs and ideas through which we program a machine. It is a style of writing programs.
Imagine this, a friend of yours asks you for a favour. Since you…
Computer Programmer 💻🕹☯️