You define carefully the input to each function, and what each function returns. In contrast, a functional approach involves composing the problem as a set of functions to be executed. This is sometimes referred to as algorithmic programming. With an imperative approach, a developer writes code that specifies the steps that the computer must take to accomplish the goal. In contrast, most mainstream languages, including object-oriented programming (OOP) languages such as C#, Visual Basic, C++, and Java, were designed to primarily support imperative (procedural) programming. Functional programming is a form of declarative programming. The functional programming paradigm was explicitly created to support a pure functional approach to problem solving. This article compares and contrasts functional programming with more traditional imperative (procedural) programming.
0 Comments
Leave a Reply. |