4 ms·
Functional typically implies higher-order functions, of which there are none in that Python code.
by tikue_ 10y ago
Functional typically implies higher-order functions, of which there are none in that Python code.
- willtim 10y agoThere is no well defined definition of functional programming. Since almost every mainstream imperative language supports higher-order functions, I would suggest that criteria is inadequate. A better definition is programming without side-effects.
- rwjwjuwjudf 10y agoOutput is a side effect.
- willtim 10y agoNot in Haskell and other pure languages. Pure functional programming is used to construct larger programs from smaller ones, which only when finally executed by the runtime produce output.
- rwjwjuwjudf 10y agoAre there any programs that produce output before they are executed?
- willtim 10y agoIt is not easy describing pure functional programming in two sentences. I encourage you to read up on it yourself. Again, IO is not a side-effect in pure languages such as Haskell. And again, the absence of side-effects best defines functional programming, not any particular feature, which imperative languages can and do steal.