There are many programming paradigms, but two of them have most spread : OOP (object-oriented programming) and FP (functional programming). Under OOP I use here Simula design and not Smalltalk one. They are different, so I bring clarity.
Whatever team of programmers you work in, there will prevail one of those two paradigms (today it's usually OOP). Reactive programming found popularity in the modern web and mobile programming. There's also procedural programming, that is rarely used in isolation from other paradigms. Must mention that exist aspect-oriented programming, agent-oriented programming, stack-oriented programming, event-driven programming, data-driven programming and many other paradigms, focused on problems of special fields.
What is the purpose of paradigms?
Just using of one or more paradigms doesn't make your code better. Usually it's opposite. Paradigms bring complexity, unnecessary for the most of programming problems. To bring benefits, they require theoretical understanding, experience solving simpler problems with them, and even ability to discard using them when they are not needed.
Most of modern object-oriented and functional languages give means to write procedural imperative code, and purely functional or object-oriented programs are rarely useful.
Many programmers approach paradigms like solving puzzles, making a game inside of the coding process. It's entertaining and gives feeling of doing something smart.
Many of others use paradigms to control and discipline young programmers, who would write an alien-style code impossible to understand for anyone but themselves.
If every programmer would work alone, writing all solutions by himself, there wouldn't be need in paradigms.
So, purpose of paradigms is to limit programmer's thinking, focusing on use of existing practices and standards.
What is the best programming paradigm?
Best programming paradigm is one you create yourself for yourself. Only this way you can reach top limits of your productivity and creativity. Of course, you will create better paradigm, if you already are familiar with other ones. If you know well only OOP, most likely anything you will try to invent will become OOP, same about every other paradigm. Ones who really benefit from paradigms are their creators. Many programmers may feel comfortable with them, never meeting potential ceiling of a specific paradigm, but talented minds shouldn't stay there for long.
No harm in trying
Paradigms that work bad for one languages may work great with other languages. Try other languages, experiment with ideas, or even invent your own programming language. Stack-oriented paradigm is a bright example of a daring experiment, challenging common understanding of programming. Forth language demonstrates power and elegance of stack programming.
Most of modern programming languages (C#, Java, C, C++) inherit ideas from 60 years old languages, reminding more syntactic sugar for those, not separate languages.
Good knowledge of mathematics would do great work for inventing new programming paradigms and languages.
It's common to think that abstract concepts align badly with hardware, and you should choose between programs performance and abstract ideas.
In fact, translating abstract ideas into assembly language is much more effective than doing so with C or C++ "low-level" mechanisms.
Abstract mathematical ideas give more freedom for portability over different platforms, and resulting assembly code may be better optimized and be much simpler.
Final
That's my second article, where I am trying to inspire young programmers to challenge spread ideas, experimenting and investigating. Thanks for reading.
Top comments (0)