Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 2.73 KB

what-are-programming-paradigms.md

File metadata and controls

19 lines (10 loc) · 2.73 KB

What are Programming Paradigms ?

article-image

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.

But why do we need programming paradigms ?

Imagine this, a friend of yours asks you for a favour. Since you are good with handwriting and forming statements, on the first day the friend asks you to write his / her name on a piece of paper. Ah that’s simple, you wrote it with precise penmanship and it’s a wonderful creation you put on paper. The second day, the same friend comes to you and asks you to write a statement about his / her personality. You activate your brain cells and think of something. You put that out on a paper and the problem solved. The third day, the same friend comes to you and asks you to write an essay about his / her friendship with yours. You are now into thinking and forming patterns to write the entire thing. Assuming this situation goes around for some days and each day your friend asks you to write on different topics. Eventually you will start forming patterns and follow it in certain cases.

We have patterns when we are writing a letter, a resume, a legal notice etc. It will always be there. So in order to solve certain problems we need to follow a certain pattern. Programming paradigms are therefore needed to solve the complexities we face while writing a program. Programming paradigms are the solution evolved from years of writing code and are proven solutions to decrease complexities and increase productivity while programming any system.

Is there only a single programming paradigm ?

Well your friend won’t be asking you to write the same things over and over again. Like that the problem we are and will be dealing will not be the same. And in order to solve different problems we will need to have a different programming paradigm. Depending on the solving a problem or solution we need to implement, we can apply a programming paradigm to it.

And how programming paradigms are classified then ? It depends on different factors like sequence of operations, how the code is organised in groups, style of syntax and grammar and many other things. So depending on the problem you need to solve, you can select a programming paradigm followed by a programming language.