SlideShare a Scribd company logo
1 of 59
Making things simple
By Robert Roose
 religion
 -noun. a set of beliefs concerning the cause,
nature, and purpose of code, which guide
programmers through the creation of software,
usually involving devotional and ritual
observations and/or gatherings, and often
containing standards governing the style of
development practices
 Advantages
 Terse
 Clarity
 Easier maintainability
 Encourages immutability
 Forces better designs
 Better testability
 Less bugs
 Disadvantages
 Difficult to design
 Difficult to visualize
 Hard for the inexperienced unenlightened
 Generally slower
 Functional programming: it’s just for those
academic types
 Functional programming: it’s fun, but it
doesn’t make money
 It makes you a better programmer
 It’s an alternative perspective of how to describe
good software design
 OOP is bad
 Side effects are evil
 Immutability is good
 Less code means less bugs
 Not everything can be side effect free
 Limitations in languages, tools, OSs…
 Bureaucracy keeps things complicated
 Not everyone follows the same religion
 Businesses aren’t about pretty math
problems
 Less code
 Less buggy code
 Happier customers
 Cheaper code
 Easier maintainability
 Quicker development
 Once developers know the ropes
What is ?
Evented I/O framework for theV8
JavaScript engine
Huh?
Takes JavaScript beyond the
browser
 Provides an easy way to build scalable
network programs
 Generally fast
 Great at concurrency
 Asynchronous everything
 Almost never blocks
 Web applications
 Especially real-time web apps
 Network applications
 Distributed systems
 General purpose applications
In node, everything runs in parallel,
except your code
Single-threaded event loop
Something isn’t right here…
But there’s only one thread
 Use processes!
 Easily scale across distributed systems
 Much safer than threads
 No need to worry about states
 Use load balancer to distribute work
 HAProxy
 nginx
 multi-node
 Simple designs
 Efficient applications
 High concurrency
 Blazingly fast for end users
 Dynamic, weakly typed multi-paradigm
scripting language
 Prototype-based
 Functional
 Imperative
 Lisp in C’s clothing
 Lots of design errors
 Lots of implementation errors
 Lots of bad books
 Lots of amateurs
 No, but it can be forced
 It’s prototype-based
 It has objects, but not classes
 It doesn’t have class-oriented inheritance – it has
prototype-oriented inheritance
 There are lots of different ways to achieve the
same thing
 Really depends on your religion
 It supports the concepts of functional
programming
 Certainly not pure
 More functional than object-oriented
 Again, it depends on your religion
 Treat variables as constants
 Think of everything as immutable
 Don’t rely on side effects
 Avoid confusion
 Return a new object instead of modifying
 Can be used as a (non-pure) functional
language
 Just use what works
 Underscore.js
 Utility-belt JavaScript library
 wu.js
 For laziness
 node-utils
 (plug)
Underscore.js
starting
reading file1.txt
got file1.txt
reading file2.txt
got file2.txt
reading file3.txt
got file3.txt
getting google
got google
...
File 1, File 2, File 3, 3bb0f168fbf8c9b0324cbf2fea1266ea
starting
reading file1.txt
reading file2.txt
reading file3.txt
getting google
got file1.txt
got file2.txt
got file3.txt
got google
...
File 1, File 2, File 3, ba5eaf36ca6e688d33ff53a466de01e1
starting
reading file1.txt
reading file2.txt
reading file3.txt
getting google
got file1.txt
got file2.txt
got file3.txt
got google
...
File 1, File 2, File 3, 065b003da0d66b14924086c8c8a1d7a6
 Attempt to expose the good parts of
JavaScript
 It’s just JavaScript
 Compiles one-to-one into the equivalent
JavaScript
 Makes JavaScript simpler
starting
reading file1.txt
reading file2.txt
reading file3.txt
getting google
got file1.txt
got file2.txt
got file3.txt
got google
...
File 1, File 2, File 3, 3290579989c493c338dcf52327442c10
 scale-example
 comet-example
Only just scratched the surface
 JavaScript
 JavaScript:TheWorld’s Most Misunderstood
Programming Language
 The Little JavaScripter
 JavaScript as a Functional Language
 Higher-Order JavaScript
 Functional Programming – Eloquent JavaScript
 Douglas Crockford
 Node.js
 How to Node
 Node Documentation
 Understanding node.js
 Combined benchmark
 Ryan Dahl
 CoffeeScript
 CoffeeScript Site
 Functional Programming
 Functional Programming Doesn'tWork (and what
to do about)
 Why functional programming doesn't catch on
 http://twitter.com/summatix
 http://www.robertroose.info/
 http://bitbucket.org/summatix
 https://github.com/summatix
 http://bitbucket.org/shivercube
 https://github.com/shivercube

More Related Content

What's hot

Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
Pierre Joye
 
HTTP::Parser::XS - writing a fast & secure XS module
HTTP::Parser::XS - writing a fast & secure XS moduleHTTP::Parser::XS - writing a fast & secure XS module
HTTP::Parser::XS - writing a fast & secure XS module
Kazuho Oku
 

What's hot (10)

Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
Александр Махомет "Beyond the code или как мониторить ваш PHP сайт"
 
Applied Shell Scripting - stills to time-lapse
Applied Shell Scripting - stills to time-lapseApplied Shell Scripting - stills to time-lapse
Applied Shell Scripting - stills to time-lapse
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
 
STP201 Efficiency at Scale - AWS re: Invent 2012
STP201 Efficiency at Scale - AWS re: Invent 2012STP201 Efficiency at Scale - AWS re: Invent 2012
STP201 Efficiency at Scale - AWS re: Invent 2012
 
HTTP::Parser::XS - writing a fast & secure XS module
HTTP::Parser::XS - writing a fast & secure XS moduleHTTP::Parser::XS - writing a fast & secure XS module
HTTP::Parser::XS - writing a fast & secure XS module
 
Chenli linux-kerne-community
Chenli linux-kerne-communityChenli linux-kerne-community
Chenli linux-kerne-community
 
Basic testing with selenium
Basic testing with seleniumBasic testing with selenium
Basic testing with selenium
 
5 things MySql
5 things MySql5 things MySql
5 things MySql
 
OSDC 2016 - DNS for Developers by Jan-Piet Mens
OSDC 2016 - DNS for Developers by Jan-Piet MensOSDC 2016 - DNS for Developers by Jan-Piet Mens
OSDC 2016 - DNS for Developers by Jan-Piet Mens
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and Django
 

Similar to Functional node.js

Novice Programmers Workshop
Novice Programmers WorkshopNovice Programmers Workshop
Novice Programmers Workshop
Alec Clews
 
Passing The Joel Test In The PHP World
Passing The Joel Test In The PHP WorldPassing The Joel Test In The PHP World
Passing The Joel Test In The PHP World
Lorna Mitchell
 
Better Functional Design through TDD
Better Functional Design through TDDBetter Functional Design through TDD
Better Functional Design through TDD
Phil Calçado
 
Developer Fundamentals - Logging
Developer Fundamentals - LoggingDeveloper Fundamentals - Logging
Developer Fundamentals - Logging
Axel Irriger
 

Similar to Functional node.js (20)

Java And Community Support
Java And Community SupportJava And Community Support
Java And Community Support
 
The Development History of PVS-Studio for Linux
The Development History of PVS-Studio for LinuxThe Development History of PVS-Studio for Linux
The Development History of PVS-Studio for Linux
 
Novice Programmers Workshop
Novice Programmers WorkshopNovice Programmers Workshop
Novice Programmers Workshop
 
Passing The Joel Test In The PHP World
Passing The Joel Test In The PHP WorldPassing The Joel Test In The PHP World
Passing The Joel Test In The PHP World
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Cs121 Unit Test
Cs121 Unit TestCs121 Unit Test
Cs121 Unit Test
 
Put to the Test
Put to the TestPut to the Test
Put to the Test
 
The Professional Programmer
The Professional ProgrammerThe Professional Programmer
The Professional Programmer
 
Pragmatic programmer
Pragmatic programmerPragmatic programmer
Pragmatic programmer
 
Top 10 Scalability Mistakes
Top 10 Scalability MistakesTop 10 Scalability Mistakes
Top 10 Scalability Mistakes
 
Top 30 Scalability Mistakes
Top 30 Scalability MistakesTop 30 Scalability Mistakes
Top 30 Scalability Mistakes
 
The Art of Evolutionary Algorithms Programming
The Art of Evolutionary Algorithms ProgrammingThe Art of Evolutionary Algorithms Programming
The Art of Evolutionary Algorithms Programming
 
Better Functional Design through TDD
Better Functional Design through TDDBetter Functional Design through TDD
Better Functional Design through TDD
 
01.intro
01.intro01.intro
01.intro
 
The Junior Developer Survival Guide - GDI Ann Arbor 2/10/15
The Junior Developer Survival Guide -  GDI Ann Arbor 2/10/15The Junior Developer Survival Guide -  GDI Ann Arbor 2/10/15
The Junior Developer Survival Guide - GDI Ann Arbor 2/10/15
 
A Backpack to go the Extra-Functional Mile (a hitched hike by the PROWESS pro...
A Backpack to go the Extra-Functional Mile (a hitched hike by the PROWESS pro...A Backpack to go the Extra-Functional Mile (a hitched hike by the PROWESS pro...
A Backpack to go the Extra-Functional Mile (a hitched hike by the PROWESS pro...
 
Developer Fundamentals - Logging
Developer Fundamentals - LoggingDeveloper Fundamentals - Logging
Developer Fundamentals - Logging
 
Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)
Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)
Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)
 
Six reasons to learn JavaScript
Six reasons to learn JavaScriptSix reasons to learn JavaScript
Six reasons to learn JavaScript
 
Welsh, Ben: The framework fix: how to build better archives by helping news n...
Welsh, Ben: The framework fix: how to build better archives by helping news n...Welsh, Ben: The framework fix: how to build better archives by helping news n...
Welsh, Ben: The framework fix: how to build better archives by helping news n...
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Functional node.js