I have read some articles on all subjects, but I don't quite get the differences.
Procedural programming uses a very detailed list of instructions to tell the computer what to do step by step. This approach uses iteration to repeat a series of steps as often as needed. Functional programming is an approach to problem solving that treats every computation as a mathematical function.
Procedural programming is based on procedure call which is locating specific tasks in procedures that are called by the main program code whenever a task needs to be completed. Structured programming is a type of programming that involves breaking the program into smaller modules of code.
The different programming styles of these languages have formed the idea programming-paradigm: C is a typical represention of the procedural, LISP of the functional, C + + of the object-oriented and PROLOG of the logic-oriented paradigm.
Structured programming is an old term that I think would encompass functional, procedural, and much else. It basically means using explicit control-flow structures rather than jumping about directly from instruction to instruction.
Functional and procedural programming are both, in that sense, structured paradigms. Functional programming is also declarative programming -- the structure given to your code corresponds to its meaning -- a program is a function that changes the state of the world. Procedural programming is what you'd consider "typical" programming in any C language or its descendants, including OO languages such as Java and C++. A program is a series of instructions, to be executed serially, and invoking subprocedures along the way.
Or, as it has been famously described:
Functional programming is like describing your problem to a mathematician. Imperative programming is like giving instructions to an idiot.
--- arcus, #scheme on Freenode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With