“Hey Underscore,
You’re doing it wrong”
You’re doing it wrong”
I <3 _
So what’s wrong then?
Underscore
Agenda

• Currying
• Composition
• Functors
• Random stuff
Currying
Curried Function
“A function that will return a new function until it
           receives all it’s arguments”
Underscore
Underscore
Underscore
...weird
Wu.js to the rescue!
  (well, one function at least)
  (well, one function at least)
Underscore
Underscore
not weird
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Example
0      0
   Example
Functional   Underscore
1      0
   Example
Functional   Underscore
2      0
   Example
Functional   Underscore
3      0
   Example
Functional   Underscore
underscore’s api
prevents you from
     currying
Underscore
Currying

• Make generic functions - data is gone
• Build new functions by applying args
• Much more concise definitions
• Make types “line up” for composition
Composition
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Category Theory
“The mathematical theory of transforming values
                  and crap”



                                *inaccurate definition
Underscore
Underscore
Underscore
Example
3      0
   Example
Functional   Underscore
4      0
   Example
Functional   Underscore
5      0
   Example
Functional   Underscore
Underscore
underscore
promotes chain as
  the function of
      choice.
Underscore
Composition
• Build new functions from other functions
• Helps build generic programs w/o args
• Extremely high level coding
• Mathematically backed
Functors
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Underscore
Example
5      0
   Example
Functional   Underscore
6      0
   Example
Functional   Underscore
7      0
   Example
Functional   Underscore
underscore explicitly
 prevents extending
        map
Underscore
s

• Change behavior without altering function
  open/closed principle
• Not just map - reduce, compose, etc
• Intuition and “non proprietary” api
• Free formulas
• Dynamic type safety?
In conclusion

More Related Content

KEY
Underscore.js
PPTX
Introduction to Underscore.js
PPTX
Introduction to underscore.js
PDF
Introduction to Underscore.js
PPTX
Introduction to es6
PDF
C# 4.0 dynamic
KEY
iOS Einführung am Beispiel von play NEXT TEE
PDF
CoffeeScript - TechTalk 21/10/2013
Underscore.js
Introduction to Underscore.js
Introduction to underscore.js
Introduction to Underscore.js
Introduction to es6
C# 4.0 dynamic
iOS Einführung am Beispiel von play NEXT TEE
CoffeeScript - TechTalk 21/10/2013

What's hot (20)

PDF
Recipes to build Code Generators for Non-Xtext Models with Xtend
PDF
Artem Yavorsky "99 ways to take away your ugly polyfills"
KEY
Objective C 基本介紹
PDF
Intro to React
PDF
React Development with the MERN Stack
PDF
Reactive Programming with JavaScript
PDF
React Native Evening
PDF
Angular 2.0: Brighter future?
PDF
How much performance can you get out of Javascript? - Massimiliano Mantione -...
PPTX
Object Oriented Programming In JavaScript
PPTX
Qtp training session IV
PPT
Function
PPTX
Vic weekly learning_20151120
PDF
How to learn Laravel5 application from Authentication
PDF
React Native One Day
PDF
Dynamic SQL in doobie
PPTX
From Ruby to Scala
PDF
__array_function__ conceptual design & related concepts
PPTX
Intro to Ruby on Rails
PPTX
Scope in AngularJs
Recipes to build Code Generators for Non-Xtext Models with Xtend
Artem Yavorsky "99 ways to take away your ugly polyfills"
Objective C 基本介紹
Intro to React
React Development with the MERN Stack
Reactive Programming with JavaScript
React Native Evening
Angular 2.0: Brighter future?
How much performance can you get out of Javascript? - Massimiliano Mantione -...
Object Oriented Programming In JavaScript
Qtp training session IV
Function
Vic weekly learning_20151120
How to learn Laravel5 application from Authentication
React Native One Day
Dynamic SQL in doobie
From Ruby to Scala
__array_function__ conceptual design & related concepts
Intro to Ruby on Rails
Scope in AngularJs
Ad

Viewers also liked (10)

PPT
Liftin every day
PPT
Js for learning
PPT
Functional Patterns for the non-mathematician
PPTX
Ricky Bobby's World
PPTX
KEY
Functional js class
PPTX
Millionways
PPTX
Fact, Fiction, and FP
PPTX
Oh Composable World!
KEY
Functional Reactive Programming in Javascript
Liftin every day
Js for learning
Functional Patterns for the non-mathematician
Ricky Bobby's World
Functional js class
Millionways
Fact, Fiction, and FP
Oh Composable World!
Functional Reactive Programming in Javascript
Ad

Similar to Underscore (20)

PDF
Functional Javascript, CVjs
PPTX
Столпы функционального программирования для адептов ООП, Николай Мозговой
PDF
introtofunctionalprogramming2-170301075633.pdf
PDF
Intro to functional programming
PPTX
Thinking Functionally with JavaScript
PDF
Functional JavaScript Fundamentals
PDF
Intro to functional programming
ODP
Functional programming
PDF
Functional Programming in JavaScript
PDF
Functional Programming for OO Programmers (part 2)
PPTX
Functional programming in javascript
PDF
Introduction to Functional Programming
PPTX
Things about Functional JavaScript
PDF
Functional programming java
PPTX
Основы функционального JS
PPTX
Functional programming for the Advanced Beginner
PDF
Some basic FP concepts
PDF
Composition birds-and-recursion
PPTX
Functional Programming in JavaScript by Luis Atencio
PDF
379008-rc217-functionalprogramming
Functional Javascript, CVjs
Столпы функционального программирования для адептов ООП, Николай Мозговой
introtofunctionalprogramming2-170301075633.pdf
Intro to functional programming
Thinking Functionally with JavaScript
Functional JavaScript Fundamentals
Intro to functional programming
Functional programming
Functional Programming in JavaScript
Functional Programming for OO Programmers (part 2)
Functional programming in javascript
Introduction to Functional Programming
Things about Functional JavaScript
Functional programming java
Основы функционального JS
Functional programming for the Advanced Beginner
Some basic FP concepts
Composition birds-and-recursion
Functional Programming in JavaScript by Luis Atencio
379008-rc217-functionalprogramming

Recently uploaded (20)

PPTX
The various Industrial Revolutions .pptx
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PDF
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
Benefits of Physical activity for teenagers.pptx
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Architecture types and enterprise applications.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Enhancing plagiarism detection using data pre-processing and machine learning...
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPT
Geologic Time for studying geology for geologist
PPTX
Microsoft Excel 365/2024 Beginner's training
The various Industrial Revolutions .pptx
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
1 - Historical Antecedents, Social Consideration.pdf
Getting started with AI Agents and Multi-Agent Systems
Benefits of Physical activity for teenagers.pptx
Custom Battery Pack Design Considerations for Performance and Safety
Convolutional neural network based encoder-decoder for efficient real-time ob...
Zenith AI: Advanced Artificial Intelligence
Architecture types and enterprise applications.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
sustainability-14-14877-v2.pddhzftheheeeee
A contest of sentiment analysis: k-nearest neighbor versus neural network
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Enhancing plagiarism detection using data pre-processing and machine learning...
Developing a website for English-speaking practice to English as a foreign la...
A proposed approach for plagiarism detection in Myanmar Unicode text
NewMind AI Weekly Chronicles – August ’25 Week III
Geologic Time for studying geology for geologist
Microsoft Excel 365/2024 Beginner's training

Underscore