[Functional Programming] – Getting Started

For functional thinking we mean that we will change our way of programming. No more imperatively, that is, program line after line, command after command expressing orders. We will program a more optimal way, so functional.

The first important point is to understand that in functional programming variables do not vary. They never change value.

There are many languages that are functional. As this is our first step I chose to use Clojure.

I will install Clojure to start playing with this concept.

This post is intended for you who like me is beginning to understand this new world.

Access the link below and perform the installation in your environment:

http://clojure.org/guides/getting_started

The second important point is understand the basic of syntax! All in this new world is functions, for we start to developer we need know it. (function params…  )  

Screen Shot 2016-06-21 at 7.03.55 PM

Importante things to now about functional programming  :

  • Variables never change the values ;
  • Syntax always will be ( function paramOne paramTwo … ) for example.
  • Functions can call functions;
  • Functions always will be the same, after you define you can’t change. Example f(x) = x +1 always when you call f(x) be x + 1 ;
  • A function always return a value;
  • A function can receive a function as parameter.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s