I have a problem, which I believe to be best solved through a functional style of programming.
Coming from a very imperative background, I am used to program design involving class diagrams/descriptions, communication diagrams, state diagrams etc. These diagrams however, all imply, or are used to describe, the state of a system and the various side effects that actions have on the system.
Are there any standardised set of diagrams or mathematical symbols used in the design of functional programs, or are such programs best designed in short functional-pseudo code (given that functions will be much shorter than imperative counterparts).
Thanks, Mike
Functional programming is a programming paradigm in which we try to bind everything in pure mathematical functions style. It is a declarative type of programming style. Its main focus is on “what to solve” in contrast to an imperative style where the main focus is “how to solve”.
Functional programming is based on mathematical functions. Some of the popular functional programming languages include: Lisp, Python, Erlang, Haskell, Clojure, etc. Pure Functional Languages − These types of functional languages support only the functional paradigms. For example − Haskell.
At its simplest, functional programming uses immutable data to tell the program exactly what to do. Object-oriented programming tells the program how to achieve results through objects altering the program's state. Both paradigms can be used to create elegant code.
C# developers are also used to other functional techniques, especially LINQ with its heavy usage of lambda expressions, and extension methods. C# supports various functional aspects so that it may be worth to take a glance at the previously introduced core fundamentals of functional programming from its perspective.
There's a secret trick to functional programming.
It's largely stateless, so the traditional imperative diagrams don't matter.
Most of ordinary, garden-variety math notation is also stateless.
Functional design is more like algebra than anything else. You're going to define functions, and show that the composition of those functions produces the desired result.
Diagrams aren't as necessary because functional programming is somewhat simpler than procedural programming. It's more like conventional mathematical notation. Use mathematical techniques to show that your various functions do the right things.
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