SlideShare a Scribd company logo
1
Functional Programming
in JavaScript & ESNext
Navin Singh, ThoughtWorks, @official_naveen
Ram Shinde, ThoughtWorks, @ramshinde92
Flock (Group of Birds)
Conjoin = Add ( + )
A B C
( x ) Breed = Multiply
A Function
● Takes a value
● Results through a return value
SAME
A Pure Function
● Takes a value, and operates only
on that value
● Given the same Input, always
gives the same Output
-------------------------------------------------------
No side effects
Domain to Range (Pure Functions)
Side Effects
- Anything occurring in our function body other than the computation of a
result.
- Observable interaction with the outside world
- List may include
- Making an API call
- Querying/Updating the DOM
- Mutations
- Interaction with FS
Functional Programming
History Definition
History
● Modelling computation
● Express computation in terms of units of expression
● A lambda Expression defines
○ Function parameters
○ Body
● Lambda Calculus by Alonzo Church
Definition
A Paradigm where computation is performed through expressions, avoiding
mutations.
The real enemy… is unexpected dependency and mutation of state, which
functional programming solves more directly and completely.
- John Carmack
Some tools
● Higher Order Functions
● Curry
● Compose
● Functors
Declarative - Do not iterate
It’s like writing expression, as opposed to step by step instructions.
It specifies what, and not how.
Higher Order Function
A Higher Order Function is a function that accepts a function as one of its
parameters and/or returns a function.
Map, Filter & Reduce are widely used.
Higher Order Function - Example
Tools - Currying
Composition
Composition - Example
Type Signatures
Type Signatures
What are they ?
They are meta language helping to understand the expression more effectively.
Why do we need them ?
Can be thought as type annotations in functional programming.
For Eg:- Typescript, Flow
System Used to define: Hindley Milner
Functors
Functors (Maybe)
Advantages of Pure Functions
● Cacheable
● Lazy Evaluation
● Referential Transparency
● Testable
● Parallel
Languages that encourage/support Functional
Programming
● Haskell
● Elm
● Erlang
● F#
● Clojure
● Scala
● OCaml
● JavaScript
Functional JavaScript Libraries
● Ramda
● Lodash/fp
● Immutable.js
● Mori.js
● RxJS
● Functional.js
● FolkTale.js
References
Mostly Adequate Guide to Functional Programming - Dr. Frisby
Functional Programming Basics in ES6 - Coding Tech
Functional Programming Series - FunFunFunction
Learning Functional Programming - Anjana Vakil
What is a functor?
Awesome FP JS
ESNext
1. What is ESNext?
2. Who designs ECMAScript?
3. How is it designed?
0 Strawman
1 Proposal
2 Draft
3 Candidate
4 Finished
What is ESNext
ESNext, simply put is the future version of ECMAScript, its nothing more that
one the weird naming conventions JS is famous for.
Who designs ECMAScript
European Computer Manufacturers Association (ECMA) is standards
organisation based in Geneva responsible for developing various standards in
this case ECMAScript code named ECMA-262.
How it's designed?
Stage 0: Strawman
- A free form way of submitting ideas, either from TC39 member or non-
member.
Stage 1: Proposal
- Make the case for the addition
- Describe the shape of a solution
- Prose outlining the problem or need and the general shape of a solution
Draft, Candidate & Finished
Stage 2: Draft
- 1st Version. Inclusion is likely.
- Requirement: Complete description is needed here.
Stage 3: Candidate
- Proposal is almost finished, waiting for feedback.
- Requirement: Spec must be complete
Stage 4: Finished
- Proposal is ready
- Requirement: TEST 262 acceptance
How to use ESNext
Use Babel with various presets:
● babel-preset-es2015, 2016, 2017 for specific versions
● "env" for including all the above versions
● ES2018 the only feature in pipeline which is actually called Pipeline is
under proposal and has its own Babel preset called @babel/plugin-proposal-
pipeline-operator
ECMAScript 2015
● Scoping: let and const
● Arrow Functions
● Parameter handling: default
params, rest params
● String interpolation
● Module import and export
● Class definitions
● Class inheritance
● Array.find()
● Spread operator
ECMAScript 2016
● Array.prototype.includes
ECMAScript 2016
● Exponentiation operator
ECMAScript 2017
ECMAScript 2017
Object.entries & values
ECMAScript 2018
Rest/Spread operator
Async Iteration
Pipeline Operator
References
TC39 Proposals : https://github.com/tc39
ECMAScript : https://en.wikipedia.org/wiki/ECMAScript
ECMA International : https://en.wikipedia.org/wiki/Ecma_International
Pipeline Operator : https://github.com/tc39/proposal-pipeline-operator
Babel : https://babeljs.io/
ESNext : https://github.com/esnext/esnext
THANK YOU
Ram Shinde
UI Developer, ThoughtWorks
ramks@thoughtworks.com
Navin Singh
UI Developer, ThoughtWorks
navinks@thoughtwoks.com
@ramshinde92 @official_naveen

More Related Content

What's hot (20)

Why functional programming in C# & F#
Why functional programming in C# & F#Why functional programming in C# & F#
Why functional programming in C# & F#
Riccardo Terrell
 
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
PROIDEA
 
Hanoi JUG: Java 8 & lambdas
Hanoi JUG: Java 8 & lambdasHanoi JUG: Java 8 & lambdas
Hanoi JUG: Java 8 & lambdas
Benoît de CHATEAUVIEUX
 
Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)
lennartkats
 
Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)
Calvin Cheng
 
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
lennartkats
 
Internal domain-specific languages
Internal domain-specific languagesInternal domain-specific languages
Internal domain-specific languages
Mikhail Barash
 
Functional Programming in Python
Functional Programming in PythonFunctional Programming in Python
Functional Programming in Python
Haim Michael
 
Typed Drupal - A great combination of Drupal 8 and PHP 7
Typed Drupal - A great combination of Drupal 8 and PHP 7Typed Drupal - A great combination of Drupal 8 and PHP 7
Typed Drupal - A great combination of Drupal 8 and PHP 7
Aditya Ghan
 
PHP = PHunctional Programming
PHP = PHunctional ProgrammingPHP = PHunctional Programming
PHP = PHunctional Programming
Luis Atencio
 
C# language
C# languageC# language
C# language
Akanksha Shukla
 
C# 9 and 10 - What's cool?
C# 9 and 10 - What's cool?C# 9 and 10 - What's cool?
C# 9 and 10 - What's cool?
Christian Nagel
 
2nd presantation
2nd presantation2nd presantation
2nd presantation
Sheay Vaishnav
 
Learn To Code: Introduction to c
Learn To Code: Introduction to cLearn To Code: Introduction to c
Learn To Code: Introduction to c
SadhanaParameswaran
 
Functional JavaScript Fundamentals
Functional JavaScript FundamentalsFunctional JavaScript Fundamentals
Functional JavaScript Fundamentals
Srdjan Strbanovic
 
WHY JAVASCRIPT FUNCTIONAL PROGRAMMING IS SO HARD?
WHY JAVASCRIPT FUNCTIONAL PROGRAMMING IS SO HARD? WHY JAVASCRIPT FUNCTIONAL PROGRAMMING IS SO HARD?
WHY JAVASCRIPT FUNCTIONAL PROGRAMMING IS SO HARD?
reactima
 
The security professional's guide to programming - Eric Vanderburg
The security professional's guide to programming - Eric VanderburgThe security professional's guide to programming - Eric Vanderburg
The security professional's guide to programming - Eric Vanderburg
Eric Vanderburg
 
C++ ch1
C++ ch1C++ ch1
C++ ch1
Venkateswarlu Vuggam
 
Keywords in python
Keywords in pythonKeywords in python
Keywords in python
PushpakBhoge
 
Implementing DSLs in practice
Implementing DSLs in practiceImplementing DSLs in practice
Implementing DSLs in practice
Mikhail Barash
 
Why functional programming in C# & F#
Why functional programming in C# & F#Why functional programming in C# & F#
Why functional programming in C# & F#
Riccardo Terrell
 
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)
PROIDEA
 
Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)
lennartkats
 
Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)Functional Programming for OO Programmers (part 1)
Functional Programming for OO Programmers (part 1)
Calvin Cheng
 
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
lennartkats
 
Internal domain-specific languages
Internal domain-specific languagesInternal domain-specific languages
Internal domain-specific languages
Mikhail Barash
 
Functional Programming in Python
Functional Programming in PythonFunctional Programming in Python
Functional Programming in Python
Haim Michael
 
Typed Drupal - A great combination of Drupal 8 and PHP 7
Typed Drupal - A great combination of Drupal 8 and PHP 7Typed Drupal - A great combination of Drupal 8 and PHP 7
Typed Drupal - A great combination of Drupal 8 and PHP 7
Aditya Ghan
 
PHP = PHunctional Programming
PHP = PHunctional ProgrammingPHP = PHunctional Programming
PHP = PHunctional Programming
Luis Atencio
 
C# 9 and 10 - What's cool?
C# 9 and 10 - What's cool?C# 9 and 10 - What's cool?
C# 9 and 10 - What's cool?
Christian Nagel
 
Learn To Code: Introduction to c
Learn To Code: Introduction to cLearn To Code: Introduction to c
Learn To Code: Introduction to c
SadhanaParameswaran
 
Functional JavaScript Fundamentals
Functional JavaScript FundamentalsFunctional JavaScript Fundamentals
Functional JavaScript Fundamentals
Srdjan Strbanovic
 
WHY JAVASCRIPT FUNCTIONAL PROGRAMMING IS SO HARD?
WHY JAVASCRIPT FUNCTIONAL PROGRAMMING IS SO HARD? WHY JAVASCRIPT FUNCTIONAL PROGRAMMING IS SO HARD?
WHY JAVASCRIPT FUNCTIONAL PROGRAMMING IS SO HARD?
reactima
 
The security professional's guide to programming - Eric Vanderburg
The security professional's guide to programming - Eric VanderburgThe security professional's guide to programming - Eric Vanderburg
The security professional's guide to programming - Eric Vanderburg
Eric Vanderburg
 
Keywords in python
Keywords in pythonKeywords in python
Keywords in python
PushpakBhoge
 
Implementing DSLs in practice
Implementing DSLs in practiceImplementing DSLs in practice
Implementing DSLs in practice
Mikhail Barash
 

Similar to Functional Programming in JavaScript & ESNext (20)

Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
datamantra
 
(3) cpp procedural programming
(3) cpp procedural programming(3) cpp procedural programming
(3) cpp procedural programming
Nico Ludwig
 
Python functional programming
Python functional programmingPython functional programming
Python functional programming
Geison Goes
 
Functional Programming - Worth the Effort
Functional Programming - Worth the EffortFunctional Programming - Worth the Effort
Functional Programming - Worth the Effort
BoldRadius Solutions
 
Introduction to functional programming
Introduction to functional programmingIntroduction to functional programming
Introduction to functional programming
Konrad Szydlo
 
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
goccy
 
New c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNew c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_iv
Nico Ludwig
 
Functional Programming.pptx
Functional Programming.pptxFunctional Programming.pptx
Functional Programming.pptx
KarthickT28
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
Aniruddha Chakrabarti
 
Intro to java 8
Intro to java 8Intro to java 8
Intro to java 8
John Godoi
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
Jorg Janke
 
GooglePropsal
GooglePropsalGooglePropsal
GooglePropsal
Ahmed Abd El-Mawgood
 
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Charles Beyer
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptx
miki304759
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
Tim Burks
 
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
Schwannden Kuo
 
Adam_Mcconnell_SPR11_v3
Adam_Mcconnell_SPR11_v3Adam_Mcconnell_SPR11_v3
Adam_Mcconnell_SPR11_v3
Adam McConnell
 
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Azilen Technologies Pvt. Ltd.
 
Functional programming
Functional programmingFunctional programming
Functional programming
PiumiPerera7
 
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Ovidiu Farauanu
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
datamantra
 
(3) cpp procedural programming
(3) cpp procedural programming(3) cpp procedural programming
(3) cpp procedural programming
Nico Ludwig
 
Python functional programming
Python functional programmingPython functional programming
Python functional programming
Geison Goes
 
Functional Programming - Worth the Effort
Functional Programming - Worth the EffortFunctional Programming - Worth the Effort
Functional Programming - Worth the Effort
BoldRadius Solutions
 
Introduction to functional programming
Introduction to functional programmingIntroduction to functional programming
Introduction to functional programming
Konrad Szydlo
 
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)これからのPerlプロダクトのかたち(YAPC::Asia 2013)
これからのPerlプロダクトのかたち(YAPC::Asia 2013)
goccy
 
New c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNew c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_iv
Nico Ludwig
 
Functional Programming.pptx
Functional Programming.pptxFunctional Programming.pptx
Functional Programming.pptx
KarthickT28
 
Intro to java 8
Intro to java 8Intro to java 8
Intro to java 8
John Godoi
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
Jorg Janke
 
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Hyperion EPM APIs - Added value from HFM, Workspace, FDM, Smartview, and Shar...
Charles Beyer
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptx
miki304759
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
Tim Burks
 
PL Lecture 01 - preliminaries
PL Lecture 01 - preliminariesPL Lecture 01 - preliminaries
PL Lecture 01 - preliminaries
Schwannden Kuo
 
Adam_Mcconnell_SPR11_v3
Adam_Mcconnell_SPR11_v3Adam_Mcconnell_SPR11_v3
Adam_Mcconnell_SPR11_v3
Adam McConnell
 
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Apple’s New Swift Programming Language Takes Flight With New Enhancements And...
Azilen Technologies Pvt. Ltd.
 
Functional programming
Functional programmingFunctional programming
Functional programming
PiumiPerera7
 
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Ovidiu Farauanu
 
Ad

More from Unfold UI (7)

Normalization in Redux
Normalization in ReduxNormalization in Redux
Normalization in Redux
Unfold UI
 
VueJs Workshop
VueJs WorkshopVueJs Workshop
VueJs Workshop
Unfold UI
 
Static Type Checking with FlowJs
Static Type Checking with FlowJsStatic Type Checking with FlowJs
Static Type Checking with FlowJs
Unfold UI
 
React Component in scala.js
React Component in scala.jsReact Component in scala.js
React Component in scala.js
Unfold UI
 
Forms, Components & Considerations
Forms, Components & ConsiderationsForms, Components & Considerations
Forms, Components & Considerations
Unfold UI
 
2D Page Layout
2D Page Layout2D Page Layout
2D Page Layout
Unfold UI
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Unfold UI
 
Normalization in Redux
Normalization in ReduxNormalization in Redux
Normalization in Redux
Unfold UI
 
VueJs Workshop
VueJs WorkshopVueJs Workshop
VueJs Workshop
Unfold UI
 
Static Type Checking with FlowJs
Static Type Checking with FlowJsStatic Type Checking with FlowJs
Static Type Checking with FlowJs
Unfold UI
 
React Component in scala.js
React Component in scala.jsReact Component in scala.js
React Component in scala.js
Unfold UI
 
Forms, Components & Considerations
Forms, Components & ConsiderationsForms, Components & Considerations
Forms, Components & Considerations
Unfold UI
 
2D Page Layout
2D Page Layout2D Page Layout
2D Page Layout
Unfold UI
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
Unfold UI
 
Ad

Recently uploaded (20)

From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Software Testing & it’s types (DevOps)
Software  Testing & it’s  types (DevOps)Software  Testing & it’s  types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework
Angelo Theodorou
 
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdfThe Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
Varsha Nayak
 
FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
Agile Software Engineering Methodologies
Agile Software Engineering MethodologiesAgile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
Revolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management SoftwareRevolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management Software
Insurance Tech Services
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FMEIntegrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025
Orangescrum
 
Integration Ignited Redefining Event-Driven Architecture at Wix - EventCentric
Integration Ignited Redefining Event-Driven Architecture at Wix - EventCentricIntegration Ignited Redefining Event-Driven Architecture at Wix - EventCentric
Integration Ignited Redefining Event-Driven Architecture at Wix - EventCentric
Natan Silnitsky
 
Plooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your wayPlooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your way
Plooma
 
Bonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdfBonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdf
Herond Labs
 
Migrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right WayMigrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right Way
Alexander (Alex) Komyagin
 
Automating Map Production With FME and Python
Automating Map Production With FME and PythonAutomating Map Production With FME and Python
Automating Map Production With FME and Python
Safe Software
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Software Testing & it’s types (DevOps)
Software  Testing & it’s  types (DevOps)Software  Testing & it’s  types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework
Angelo Theodorou
 
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdfThe Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
The Future of Open Source Reporting Best Alternatives to Jaspersoft.pdf
Varsha Nayak
 
FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
Agile Software Engineering Methodologies
Agile Software Engineering MethodologiesAgile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
Revolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management SoftwareRevolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management Software
Insurance Tech Services
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FMEIntegrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025Top 5 Task Management Software to Boost Productivity in 2025
Top 5 Task Management Software to Boost Productivity in 2025
Orangescrum
 
Integration Ignited Redefining Event-Driven Architecture at Wix - EventCentric
Integration Ignited Redefining Event-Driven Architecture at Wix - EventCentricIntegration Ignited Redefining Event-Driven Architecture at Wix - EventCentric
Integration Ignited Redefining Event-Driven Architecture at Wix - EventCentric
Natan Silnitsky
 
Plooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your wayPlooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your way
Plooma
 
Bonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdfBonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdf
Herond Labs
 
Automating Map Production With FME and Python
Automating Map Production With FME and PythonAutomating Map Production With FME and Python
Automating Map Production With FME and Python
Safe Software
 
Providing Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better DataProviding Better Biodiversity Through Better Data
Providing Better Biodiversity Through Better Data
Safe Software
 

Functional Programming in JavaScript & ESNext

  • 1. 1
  • 2. Functional Programming in JavaScript & ESNext Navin Singh, ThoughtWorks, @official_naveen Ram Shinde, ThoughtWorks, @ramshinde92
  • 3. Flock (Group of Birds) Conjoin = Add ( + ) A B C ( x ) Breed = Multiply
  • 4. A Function ● Takes a value ● Results through a return value
  • 5. SAME A Pure Function ● Takes a value, and operates only on that value ● Given the same Input, always gives the same Output ------------------------------------------------------- No side effects
  • 6. Domain to Range (Pure Functions)
  • 7. Side Effects - Anything occurring in our function body other than the computation of a result. - Observable interaction with the outside world - List may include - Making an API call - Querying/Updating the DOM - Mutations - Interaction with FS
  • 9. History ● Modelling computation ● Express computation in terms of units of expression ● A lambda Expression defines ○ Function parameters ○ Body ● Lambda Calculus by Alonzo Church
  • 10. Definition A Paradigm where computation is performed through expressions, avoiding mutations. The real enemy… is unexpected dependency and mutation of state, which functional programming solves more directly and completely. - John Carmack
  • 11. Some tools ● Higher Order Functions ● Curry ● Compose ● Functors
  • 12. Declarative - Do not iterate It’s like writing expression, as opposed to step by step instructions. It specifies what, and not how.
  • 13. Higher Order Function A Higher Order Function is a function that accepts a function as one of its parameters and/or returns a function. Map, Filter & Reduce are widely used.
  • 19. Type Signatures What are they ? They are meta language helping to understand the expression more effectively. Why do we need them ? Can be thought as type annotations in functional programming. For Eg:- Typescript, Flow System Used to define: Hindley Milner
  • 22. Advantages of Pure Functions ● Cacheable ● Lazy Evaluation ● Referential Transparency ● Testable ● Parallel
  • 23. Languages that encourage/support Functional Programming ● Haskell ● Elm ● Erlang ● F# ● Clojure ● Scala ● OCaml ● JavaScript
  • 24. Functional JavaScript Libraries ● Ramda ● Lodash/fp ● Immutable.js ● Mori.js ● RxJS ● Functional.js ● FolkTale.js
  • 25. References Mostly Adequate Guide to Functional Programming - Dr. Frisby Functional Programming Basics in ES6 - Coding Tech Functional Programming Series - FunFunFunction Learning Functional Programming - Anjana Vakil What is a functor? Awesome FP JS
  • 26. ESNext 1. What is ESNext? 2. Who designs ECMAScript? 3. How is it designed? 0 Strawman 1 Proposal 2 Draft 3 Candidate 4 Finished
  • 27. What is ESNext ESNext, simply put is the future version of ECMAScript, its nothing more that one the weird naming conventions JS is famous for. Who designs ECMAScript European Computer Manufacturers Association (ECMA) is standards organisation based in Geneva responsible for developing various standards in this case ECMAScript code named ECMA-262.
  • 28. How it's designed? Stage 0: Strawman - A free form way of submitting ideas, either from TC39 member or non- member. Stage 1: Proposal - Make the case for the addition - Describe the shape of a solution - Prose outlining the problem or need and the general shape of a solution
  • 29. Draft, Candidate & Finished Stage 2: Draft - 1st Version. Inclusion is likely. - Requirement: Complete description is needed here. Stage 3: Candidate - Proposal is almost finished, waiting for feedback. - Requirement: Spec must be complete Stage 4: Finished - Proposal is ready - Requirement: TEST 262 acceptance
  • 30. How to use ESNext Use Babel with various presets: ● babel-preset-es2015, 2016, 2017 for specific versions ● "env" for including all the above versions ● ES2018 the only feature in pipeline which is actually called Pipeline is under proposal and has its own Babel preset called @babel/plugin-proposal- pipeline-operator
  • 31. ECMAScript 2015 ● Scoping: let and const ● Arrow Functions ● Parameter handling: default params, rest params ● String interpolation ● Module import and export ● Class definitions ● Class inheritance ● Array.find() ● Spread operator
  • 38. References TC39 Proposals : https://github.com/tc39 ECMAScript : https://en.wikipedia.org/wiki/ECMAScript ECMA International : https://en.wikipedia.org/wiki/Ecma_International Pipeline Operator : https://github.com/tc39/proposal-pipeline-operator Babel : https://babeljs.io/ ESNext : https://github.com/esnext/esnext
  • 39. THANK YOU Ram Shinde UI Developer, ThoughtWorks [email protected] Navin Singh UI Developer, ThoughtWorks [email protected] @ramshinde92 @official_naveen

Editor's Notes

  • #13: Add some more pointers
  • #19: Talk about why this comment in code is valid.
  • #27: Add slide for What is ESNext and Who designs ECMAScript Who designs it => TC39 How is it designed => 5 stages ES6 with house full of features was a problem So TC39 came with 5 stages solution thereby releasing features frequently
  • #28: Add slide for What is ESNext and Who designs ECMAScript Who designs it => TC39 How is it designed => 5 stages ES6 with house full of features was a problem So TC39 came with 5 stages solution thereby releasing features frequently
  • #29: Stage 1: Champion must be identified who is responsible for proposal, Champion or co-champion must be member of TC39
  • #30: Stage 4: ECMAScript spec editor must sign off All these stages are not confirmations, they are just probables Confirmation is after they clear spec editor
  • #31: Stage 4: ECMAScript spec editor must sign off All these stages are not confirmations, they are just probables Confirmation is after they clear spec editor