The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,230 other followers

Archive for the ‘Functional Programming’ Category

A series of Medium posts introducing functional programming in manageable bits and pieces

Posted by jpluimers on 2020/09/30

I have summarised the main topics of each part in this table of contents, and indicated at the time of writing which parts I did not get yet:

  1. [WayBack] So You Want to be a Functional Programmer (Part 1) – Charles Scalfani – Medium
    • pure functions (only operate on input parameters: without side effects)
    • immutability (no variables! loops through recursion)
  2. [WayBack] So You Want to be a Functional Programmer (Part 2) – Charles Scalfani – Medium
    • refactoring leads to the need of higher-order functions
    • higher-order functions: passing a function as a parameter, or returning functions as a result
    • closure: when a returned function has access to the captured parameter(s) of the function creating the returned function
  3. [WayBack] So You Want to be a Functional Programmer (Part 3) – Charles Scalfani – Medium
    • functional decomposition (I still need to wrap my head around this)
    • point-free notation (same)
    • both lead to currying (which I also need to wrap my head around)
  4. [WayBack] So You Want to be a Functional Programmer (Part 4) – Charles Scalfani – Medium
    • currying: when you want to combine functions having different parameter counts
    • refactoring based on currying (I still need to wrap my head around this)
    • map/filter/reduce functional building blocks (I still need to wrap my head around this)
  5. [WayBack] So You Want to be a Functional Programmer (Part 5) – Charles Scalfani – Medium
    • referential transparency (I still need to wrap my head around this)
    • execution order: in a pure functional language the compiler can determine the order when functions are completely independent
    • type annotation: I do not yet get why you would do without this
  6. [WayBack] So You Want to be a Functional Programmer (Part 6) – Charles Scalfani – Medium
    • Functional JavaScript and ELM: two functional languages, of which Ramba can help make better JavaScript code

Via: [WayBack] So You Want to be a Functional Programmer (Part 1) Link to part 2 in the article. https://medium.com/@cscalfani/so-you-want-to-be-a-functional-programm… – Lars Fosdal – Google+

–jeroen

Posted in Development, Functional Programming, Software Development | Leave a Comment »

Great video “Why Functional Programming Matters”, by Ted Neward on getting started with Functional Programming

Posted by jpluimers on 2019/10/10

Great introduction into functional programming by a step by step: “Why Functional Programming Matters”, by Ted Neward on Devoxx Poland 2016.

It uses Java, but translates very well into C#, C++, Delphi and many other programming languages because the underlying support structures are very easy (a ~50 line Lists class, a few Function# prototypes, etc).

Two great observations here:

  • most variables don’t vary
  • collections are the gateway drug to becoming functional programmers

Summary

Coding Tech

In the latter half of the 2000s, a new kind of programming language seemed poised to take the steam out of the dominancen of object-oriented programming languages and their hold over “mainstream” development. But these new languages, collectively referred to as “functional” languages, were nothing new. In fact, they’ve been a part of the language landscape since the late 80s, and arguably even longer than that. What makes a functional language, and what makes a functional language interesting? Most importantly, why do we care now, thirty years after their introduction?

https://www.youtube.com/watch?v=oB8jN68KGcU

–jeroen

Read the rest of this entry »

Posted in Conference Topics, Conferences, Development, Event, Functional Programming, Software Development | Leave a Comment »

“Functional programmer: (noun) One who names variables ‘x’, names functions ‘f’, and names code patterns ‘zygohistomorphic prepromorphism.'” — James Iry on Twitter

Posted by jpluimers on 2019/09/04

“Functional programmer: (noun) One who names variables ‘x’, names functions ‘f’, and names code patterns ‘zygohistomorphic prepromorphism.'” — James Iry

–jeroen

Read the rest of this entry »

Posted in Development, Fun, Functional Programming, Quotes, Software Development, T-Shirt quotes | Leave a Comment »

Functional programming in C# – CodeProject

Posted by jpluimers on 2018/04/04

Interesting stuff:

This article discusses functional programming in C# through algebra, numbers, euclidean plane and fractals.

[WayBackFunctional programming in C# – CodeProject

Not the least because of images like below.

–jeroen

.

Posted in Development, Functional Programming, Software Development | Leave a Comment »

Robert C Martin – Functional Programming; What? Why? When? – YouTube

Posted by jpluimers on 2016/12/26

Great after X-mas watch: Robert C Martin – Functional Programming; What? Why? When? – YouTube subtitled “the failure of state”.

Thanks [WayBackAndrew Rohn – YouTube for the timestamp list:

  • 4:07 “Functional Programming: What? When? Why?” or “The Failure of State”
  • 5:10 Rich Hickey is the author of Clojure. Listen to his talks. 5:40 What is state? Variables.
  • 11:15 Structure and Interpretation of Computer Programs. This is a fascinating book. For the first 250 pages, the book uses no assignment statements.
  • 14:15 Here’s how SICP’s model of computing worked before they introduced an assignment statement. Simply replace a function call with its implementation.
  • 15:58 Once you introduce assignment. You can no longer replace a function call with its implementation. Why? Because the state of the system may have changed. An assignment statement introduces the concept of time.
  • 18:04 Side effect: an assignment statement. If there’s no assignment, there’s no side effect.
  • 20:22 What “hack” have we done to protect us from memory leaks? Garbage collection.
  • 31:46 Functional programming was invented in 1957 before OO and structured. But memory was too expensive to make it practical. But memory is cheap now.
  • 32:53 Should we change how we program? We should because: 1) Functional programs are simpler – which makes them easier to write and maintain 2) There’s no temporal coupling – no worrying if some function was called before another function. 3) Fewer concurrency issues. In a purely functional program, there’s no concurrency because there is no state. 4) No asking, “What’s the state?”
  • 38:38 We’re using multicore CPU’s now because we can’t increase clock rate anymore. And hardware makers are doing bizarre tradeoffs. They’re making individual processors slower but putting more processors in. So individual cores slow down but the chip throughput goes up if you can take advantage of all the cores.
  • 42:00 How are you going to work with an abundance of cores? Maybe we need to walk away from the assignment statement.
  • 49:49 OO = procedure + state. OO is exposed procedure but hidden state (encapsulation). It’s possible to write functional programs using an OO style. All of the objects become immutable.

–jeroen

Posted in Design Patterns, Development, Functional Programming, Software Development | Leave a Comment »

 
%d bloggers like this: