Functional Programming - Deepstash

Bite-sized knowledge

to upgrade

your career

Ideas from books, articles & podcasts.

created 7 ideas

Not your object oriented programming

GITHUB

Functional Programming

Functional Programming

joshi-aparna.github.io

STASHED IN:

826 reads

What Is Functional Programming

Funcational Programming is a declarative way of programming.

Remember how we assign different values to a variable through out the program? How we use setters in classes to modify the value of class variables? That is not allowed in FP. A variable once set remains unchanged. Sort of like, making all variables final.We usually think of variable...

If a function returns same value for the same argument every time, then the function is pure. That generally means that, the function cannot use any state values that could potentially change.

In OOP we treat data and functions separately. In FP, they are all the same. We can create an array of functions, pass a function as argument, return a function from a method.

Let's say there is a function that takes three arguments. Usually, we need to be aware of all three values to call this function, right? In partial application, the three arguments are provided at different times. I could not find a decent blog that explains this well.

Recursion is when a function calls itself and an end condition exists in the function to stop the method call. We could talk about this in depth another day. For now, here is a good explanation.

This is a method where we take simple functions and combine them into a more complex function. Let's say we have two methods f(x) = x * 2 //(timesTwo) and f(x) = x - 1 // (minusOne) . And we want to compute f(x) = 2x -1 . You call the timesTwo f...

10 Reactions

Comment

MORE LIKE THIS

created 4 ideas

As I strive to become a better python programmer, I’ve started using type hints and created this intro guide

1

Comment

48 reads

created 5 ideas

Data validation using Pydantic in python

React

Comment

24 reads

It's time to

READ

LIKE

A PRO!

Jump-start your

reading habits

, gather your

knowledge

,

remember what you read

and stay ahead of the crowd!

Takes just 5 minutes a day.


TRY THE DEEPSTASH APP

+2M Installs

4.7 App Score