SlideShare una empresa de Scribd logo
1 de 55
Descargar para leer sin conexión
THE IDEAS OF CLOJURE
JCConf 2015/12/04
Randy Lien
Things I learn from Clojure
About me
@randylien
UI Engineer
#WebAppsRocks
#JavaScriptIsNotSoJavaScript
#WhenIsNextReactJS.TwMeetup
#clojurians.tw@facebook
Survey!
• Heard Clojure?
• Clojure developer?
• Enjoy Java development?
“I don’t know Java.”
– Speaker
History of programming languages
LISP
Clojure ?
React.js Conf 2015
Tapestry Dude - https://goo.gl/R5m3am (CC BY-SA 2.0)
The Creator of Clojure

Rich Hickey
"Hickey is the new Messiah of software development. Watch
and listen to his talks, and you will understand."
– http://bepsays.com/2014/07/08/how-rich-is-rich-hickey/
Few ideas I want to share
Philosophy
Philosophy
Focus
Simplicity
Empowerment
Pure functions
Expressive Practical
Clarity

Consistency
Separation 

of 

concerns
Concise
Direct
Interop
- The Joy of Clojure
Philosophy - Simplicity
• Pure functions
• Immutable
• Simple abstractions
• defprotocol
• deftype
Philosophy - Focus
• Syntax will not bother you
• Consistency
• Dynamic System
• Almost everything defined in Clojure can be
redefined (Even while program is running)
• Use Macro you can build anything you want to do
Philosophy - Empowerment
• Use Java Virtual Machine
• Java is mature and has many libraries
• JavaScript is everywhere (ClojureScript)
Consistency
Syntax does matter
Java + Python + JavaScript ?
JaPythonScript?
Data Types
• Integers - 123
• Doubles - 1.23
• Ratios - 1/23
• Strings - "JCConf"
• "Double Quotes Only"
• Characters - J C
Data Types (cont.)
• Symbols - bar
• Keywords - :foo
• Booleans - true false
• Null - nil
• Regex - #"[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]+"
Data Structure
• Lists - (1 2 3)
• Prepend
• Vectors - [1 2 3]
• Zero indexed. Append
• Maps - {:a 1, :b 2, :c "3"}
• Key-value pair
• Comma will be ignored
• Sets - #{1 2 3}
• Unique. Unordered
function definition
function definition
doc string
Clojure
• (+ 1 2)
• (+ 1 2 3)
• (into [] 2)
General
• 1 + 2
• 1 + 2 + 3
• [].push(2)
Use host libraries - Java
Use host libraries - JavaScript
DEMO
functions & composition
functions & composition
• map, reduce, filter
• partial, comp
• iterate
• repeat, repeatedly
• Many built-in functions and you don’t need to create.

Just compose it!
DEMO
Values
Values should be…
• Value!
• operated by functions
• time-relative
• Immutable
Why Immutable?
Why mutable?
Why mutable?
• Limitations of early computers: Small RAM and disk
• New information replaces old
Why
immutable?
• No resource limitation
• Persistent data structure
• Record - Share the same data
• Key to do functional programming
• No side effect
• atom is mutable
REPL Driven Development
REPL ?
• Read–Eval–Print Loop
• nREPL (network REPL)
• Good for doing TDD
• clojure.test
• ClojureScript - Browser can connect to nREPL
REPL
DEMO - ClojureScript
REPL
DEMO - Clojure
Tooling Eco-system
Clojars
emacs
LightTable
Leiningen
Summary
Summary
• Clojure is a practical functional programming language
• Java and JavaScript are two major languages and
Clojure and ClojureScript can run on them
• Using REPL in your TDD practices would be helpful
• Pure functions and Immutable data structure can make
your system stable and easy to reason about
Summary (cont.)
• Clojure has much better tooling and keep improving it
• ClojureScript is hotter than Clojure!
• Many companies are using Clojure
• booking.com, Yahoo, Puppet, Walmart, twitter,
heroku, nubank…etc
• STM, transducer, core.asyn
If you want to know more…
• Living Clojure
• The Joy of Clojure
• ClojureScript Unraveled
• Clojure Applied
• Clojure for the Brave and True
Online resource
• http://www.tryclj.com/
• http://www.4clojure.com/
Worth to watch
• Simple Made Easy
• Clojure Made Simple
• The Value of Values
• The Language of the System
Thanks

Más contenido relacionado

La actualidad más candente

Charting in your browser with html5 and java script
Charting in your browser with html5 and java scriptCharting in your browser with html5 and java script
Charting in your browser with html5 and java script
Maxime Rouiller
 

La actualidad más candente (20)

Tf byowwhc
Tf byowwhcTf byowwhc
Tf byowwhc
 
Tf byowwhc
Tf byowwhcTf byowwhc
Tf byowwhc
 
Presentation
PresentationPresentation
Presentation
 
Charting in your browser with html5 and java script
Charting in your browser with html5 and java scriptCharting in your browser with html5 and java script
Charting in your browser with html5 and java script
 
Web pro
Web proWeb pro
Web pro
 
Components vs Frameworks
Components vs FrameworksComponents vs Frameworks
Components vs Frameworks
 
Web Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo FadojutimiWeb Development and Web Development technologies - Temitayo Fadojutimi
Web Development and Web Development technologies - Temitayo Fadojutimi
 
Modern front end development
Modern front end developmentModern front end development
Modern front end development
 
Apereo 2018 - Webcomponents and building a unified authoring experience for a...
Apereo 2018 - Webcomponents and building a unified authoring experience for a...Apereo 2018 - Webcomponents and building a unified authoring experience for a...
Apereo 2018 - Webcomponents and building a unified authoring experience for a...
 
Fast Web Applications with Go
Fast Web Applications with Go Fast Web Applications with Go
Fast Web Applications with Go
 
Metaprogramming Go
Metaprogramming GoMetaprogramming Go
Metaprogramming Go
 
Developer skills
Developer skillsDeveloper skills
Developer skills
 
How To be a Backend developer
How To be a Backend developer    How To be a Backend developer
How To be a Backend developer
 
Style Validator at breakout session of TPAC2015
Style Validator at breakout session of TPAC2015Style Validator at breakout session of TPAC2015
Style Validator at breakout session of TPAC2015
 
Good, bad, web.
Good, bad, web.Good, bad, web.
Good, bad, web.
 
Bridging the gap between UX and development - A Storybook by Marko Letic at F...
Bridging the gap between UX and development - A Storybook by Marko Letic at F...Bridging the gap between UX and development - A Storybook by Marko Letic at F...
Bridging the gap between UX and development - A Storybook by Marko Letic at F...
 
Angular SEO
Angular SEO Angular SEO
Angular SEO
 
Tf byow
Tf byowTf byow
Tf byow
 
Tf byow
Tf byowTf byow
Tf byow
 
Web development using javaScript, React js, Node js, HTML, CSS and SQL
Web development using javaScript, React js, Node js, HTML, CSS and SQLWeb development using javaScript, React js, Node js, HTML, CSS and SQL
Web development using javaScript, React js, Node js, HTML, CSS and SQL
 

Destacado

Gomezportfolio
GomezportfolioGomezportfolio
Gomezportfolio
bobbi
 
Directo y sin escalas
Directo y sin escalasDirecto y sin escalas
Directo y sin escalas
lmuia
 

Destacado (20)

Get into Functional Programming with Clojure
Get into Functional Programming with ClojureGet into Functional Programming with Clojure
Get into Functional Programming with Clojure
 
Raptedavid hanane
Raptedavid hananeRaptedavid hanane
Raptedavid hanane
 
Saving the KoalaS
Saving the KoalaSSaving the KoalaS
Saving the KoalaS
 
Crowdfunding - meer dan geld alleen - STIMA
Crowdfunding  - meer dan geld alleen - STIMACrowdfunding  - meer dan geld alleen - STIMA
Crowdfunding - meer dan geld alleen - STIMA
 
A messaging app for teams.... who think differently
A messaging app for teams.... who think differentlyA messaging app for teams.... who think differently
A messaging app for teams.... who think differently
 
Italian Version: Disasters 2.0: Collaborazione in Tempo Reale: Documentazione...
Italian Version: Disasters 2.0: Collaborazione in Tempo Reale: Documentazione...Italian Version: Disasters 2.0: Collaborazione in Tempo Reale: Documentazione...
Italian Version: Disasters 2.0: Collaborazione in Tempo Reale: Documentazione...
 
Sociale dynamiek op crowdfunding platformen
Sociale dynamiek op crowdfunding platformenSociale dynamiek op crowdfunding platformen
Sociale dynamiek op crowdfunding platformen
 
0859424The Beijing Olympic Games in 2008
0859424The Beijing Olympic Games in 20080859424The Beijing Olympic Games in 2008
0859424The Beijing Olympic Games in 2008
 
EU negotiations in practice - second lecture, 23 November 2010
EU negotiations in practice - second lecture, 23 November 2010EU negotiations in practice - second lecture, 23 November 2010
EU negotiations in practice - second lecture, 23 November 2010
 
Euro IA In The Kitchen
Euro IA In The KitchenEuro IA In The Kitchen
Euro IA In The Kitchen
 
Replay Tv
Replay TvReplay Tv
Replay Tv
 
090130_Journal_Club
090130_Journal_Club090130_Journal_Club
090130_Journal_Club
 
感悟人生
感悟人生感悟人生
感悟人生
 
Gomezportfolio
GomezportfolioGomezportfolio
Gomezportfolio
 
Directo y sin escalas
Directo y sin escalasDirecto y sin escalas
Directo y sin escalas
 
Webware test
Webware testWebware test
Webware test
 
Of brains and buttons
Of brains and buttonsOf brains and buttons
Of brains and buttons
 
วารสารเทคโนโลยีสื่อสารการศึกษา
วารสารเทคโนโลยีสื่อสารการศึกษาวารสารเทคโนโลยีสื่อสารการศึกษา
วารสารเทคโนโลยีสื่อสารการศึกษา
 
Digital Art
Digital ArtDigital Art
Digital Art
 
His m03t18a
His m03t18aHis m03t18a
His m03t18a
 

Similar a The Ideas of Clojure - Things I learn from Clojure

Dev ops lessons learned - Michael Collins
Dev ops lessons learned  - Michael CollinsDev ops lessons learned  - Michael Collins
Dev ops lessons learned - Michael Collins
Devopsdays
 
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
Derek Allard
 
Building rich interface components with SharePoint
Building rich interface components with SharePointBuilding rich interface components with SharePoint
Building rich interface components with SharePoint
Louis-Philippe Lavoie
 

Similar a The Ideas of Clojure - Things I learn from Clojure (20)

Dev ops lessons learned - Michael Collins
Dev ops lessons learned  - Michael CollinsDev ops lessons learned  - Michael Collins
Dev ops lessons learned - Michael Collins
 
Into the Land of lambda, One Programmer's Journey Into Functional Programming
Into the Land of lambda, One Programmer's Journey Into Functional ProgrammingInto the Land of lambda, One Programmer's Journey Into Functional Programming
Into the Land of lambda, One Programmer's Journey Into Functional Programming
 
The Silver Bullet Syndrome by Alexey Vasiliev
The Silver Bullet Syndrome by Alexey VasilievThe Silver Bullet Syndrome by Alexey Vasiliev
The Silver Bullet Syndrome by Alexey Vasiliev
 
Clojure in real life 17.10.2014
Clojure in real life 17.10.2014Clojure in real life 17.10.2014
Clojure in real life 17.10.2014
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Frontend as a first class citizen
Frontend as a first class citizenFrontend as a first class citizen
Frontend as a first class citizen
 
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
Standing on the Shoulders of Giants: How Community Shapes Development in Elli...
 
Scaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHPScaling a High Traffic Web Application: Our Journey from Java to PHP
Scaling a High Traffic Web Application: Our Journey from Java to PHP
 
Scaling High Traffic Web Applications
Scaling High Traffic Web ApplicationsScaling High Traffic Web Applications
Scaling High Traffic Web Applications
 
Ice dec05-04-wan leung
Ice dec05-04-wan leungIce dec05-04-wan leung
Ice dec05-04-wan leung
 
Building rich interface components with SharePoint
Building rich interface components with SharePointBuilding rich interface components with SharePoint
Building rich interface components with SharePoint
 
Jquery react angular
Jquery react angularJquery react angular
Jquery react angular
 
Full stack development using javascript what and why - ajay chandravadiya
Full stack development using javascript   what and why - ajay chandravadiyaFull stack development using javascript   what and why - ajay chandravadiya
Full stack development using javascript what and why - ajay chandravadiya
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidad
 
SGCE 2015 REST APIs
SGCE 2015 REST APIsSGCE 2015 REST APIs
SGCE 2015 REST APIs
 
Experience Converting from Ruby to Scala
Experience Converting from Ruby to ScalaExperience Converting from Ruby to Scala
Experience Converting from Ruby to Scala
 
Craft Beer & Clojure
Craft Beer & ClojureCraft Beer & Clojure
Craft Beer & Clojure
 

Más de Hsuan Fu Lien (9)

Django Girls 2015 - CSS
Django Girls 2015 - CSSDjango Girls 2015 - CSS
Django Girls 2015 - CSS
 
Django Girls 2015 - HTML
Django Girls 2015 -  HTMLDjango Girls 2015 -  HTML
Django Girls 2015 - HTML
 
React.JS Conf & F8
React.JS Conf & F8React.JS Conf & F8
React.JS Conf & F8
 
Immutable, performance and components communication
Immutable, performance and components communicationImmutable, performance and components communication
Immutable, performance and components communication
 
Introduce Flux & react in practices (KKBOX)
Introduce Flux & react in practices (KKBOX)Introduce Flux & react in practices (KKBOX)
Introduce Flux & react in practices (KKBOX)
 
What is the next step for a front end beginner
What is the next step for a front end beginnerWhat is the next step for a front end beginner
What is the next step for a front end beginner
 
Introduce flux & react in practice
Introduce flux & react in practiceIntroduce flux & react in practice
Introduce flux & react in practice
 
UI Engineering Introduction
UI Engineering IntroductionUI Engineering Introduction
UI Engineering Introduction
 
Using Yeoman to develop Web App
Using Yeoman to develop Web AppUsing Yeoman to develop Web App
Using Yeoman to develop Web App
 

Último

+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@
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.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...
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation 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...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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 ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

The Ideas of Clojure - Things I learn from Clojure