3 ms·
>To me, a for loop is an imperative construct, and map and reduce are functional constructs, regardless of how any of them are implemented. Well if the map is
by crimsonalucard 9y ago
>To me, a for loop is an imperative construct, and map and reduce are functional constructs, regardless of how any of them are implemented.
Well if the map is implemented using muteable variables then it is not a functional construct is it? If your entire program utilizes maps and filters and folds but is muteable then it is not a functional construct. Here is the definition of a functional language according to Wikipedia:
"In computer science, functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. It is a declarative programming paradigm, which means programming is done with expressions[1] or declarations[2] instead of statements."