3 ms·
Broadly speaking, imperative programming allows one to start coding a solution before one understands the problem. Functional programming is generally more abs
by craigsmansion 10y ago
Broadly speaking, imperative programming allows one to start coding a solution before one understands the problem.
Functional programming is generally more abstract in its approach to modelling the problem. If you get the model wrong, you will not end up with a working solution, forcing you to rethink your model.
While imperative programming allows you to reiterate towards a solution as you start to understand the problem better as you work towards it, it's obviously better and faster if your initial model of the problem is more accurate.
Functional programming forces you to create a viable model of the problem before you start. If you can extend that discipline over to an imperative language, you will need less iteration and the resulting solution will likely be more elegant.
The argument is not (or shouldn't be) about concepts, but about paradigms and discipline.