SlideShare a Scribd company logo
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
The Ideas of Clojure - Things I learn from Clojure
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)
The Ideas of Clojure - Things I learn from Clojure
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/
The Ideas of Clojure - Things I learn from Clojure
Worth to watch
• Simple Made Easy
• Clojure Made Simple
• The Value of Values
• The Language of the System
Thanks

More Related Content

KEY
Why You Need a Front End Developer
PDF
Understand front end developer
PPTX
HAXTHEWEB - Drupal 4 Gov webinar
PPTX
Web development - Developing Web as A Team
PDF
What is front-end development ?
PDF
Design and Development Techniques for Accessibility: WordCamp Tampa 2015
PDF
Style Guides, Pattern Libraries, Design Systems and other amenities.
PDF
Modern UX, UI, and front-end tools
Why You Need a Front End Developer
Understand front end developer
HAXTHEWEB - Drupal 4 Gov webinar
Web development - Developing Web as A Team
What is front-end development ?
Design and Development Techniques for Accessibility: WordCamp Tampa 2015
Style Guides, Pattern Libraries, Design Systems and other amenities.
Modern UX, UI, and front-end tools

What's hot (20)

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

Viewers also liked (20)

PDF
Get into Functional Programming with Clojure
PPS
Saving the KoalaS
PDF
Crowdfunding - meer dan geld alleen - STIMA
PDF
A messaging app for teams.... who think differently
PPTX
Italian Version: Disasters 2.0: Collaborazione in Tempo Reale: Documentazione...
PDF
Sociale dynamiek op crowdfunding platformen
PPT
0859424The Beijing Olympic Games in 2008
KEY
EU negotiations in practice - second lecture, 23 November 2010
PDF
Euro IA In The Kitchen
PPT
Replay Tv
PPT
090130_Journal_Club
PPS
感悟人生
PPS
Gomezportfolio
PDF
Directo y sin escalas
PPT
Webware test
PDF
Of brains and buttons
PDF
วารสารเทคโนโลยีสื่อสารการศึกษา
PPT
PDF
His m03t18a
Get into Functional Programming with Clojure
Saving the KoalaS
Crowdfunding - meer dan geld alleen - STIMA
A messaging app for teams.... who think differently
Italian Version: Disasters 2.0: Collaborazione in Tempo Reale: Documentazione...
Sociale dynamiek op crowdfunding platformen
0859424The Beijing Olympic Games in 2008
EU negotiations in practice - second lecture, 23 November 2010
Euro IA In The Kitchen
Replay Tv
090130_Journal_Club
感悟人生
Gomezportfolio
Directo y sin escalas
Webware test
Of brains and buttons
วารสารเทคโนโลยีสื่อสารการศึกษา
His m03t18a
Ad

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

PDF
Clojure made-simple - John Stevenson
ODP
Getting started with Clojure
PDF
Introduction to Clojure
PDF
Clojure in real life 17.10.2014
PDF
Functional web with clojure
PDF
Clojure for Java developers
PDF
Clojure and The Robot Apocalypse
PDF
Introduction to clojure
PDF
Exploring Clojurescript
PDF
ClojureScript for the web
PDF
Clojure
PDF
Functional Programming in Clojure
PPTX
Clojure Fundamentals Course For Beginners
ODP
Programming with Freedom & Joy
PDF
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
PDF
Fun with Functional Programming in Clojure
PPTX
Intro to Clojure lightningtalk
PDF
Introductory Clojure Presentation
PDF
I know Java, why should I consider Clojure?
PPTX
Why clojure(script) matters
Clojure made-simple - John Stevenson
Getting started with Clojure
Introduction to Clojure
Clojure in real life 17.10.2014
Functional web with clojure
Clojure for Java developers
Clojure and The Robot Apocalypse
Introduction to clojure
Exploring Clojurescript
ClojureScript for the web
Clojure
Functional Programming in Clojure
Clojure Fundamentals Course For Beginners
Programming with Freedom & Joy
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
Fun with Functional Programming in Clojure
Intro to Clojure lightningtalk
Introductory Clojure Presentation
I know Java, why should I consider Clojure?
Why clojure(script) matters

More from Hsuan Fu Lien (9)

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

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
KodekX | Application Modernization Development
PPTX
Big Data Technologies - Introduction.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
PPTX
A Presentation on Artificial Intelligence
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
KodekX | Application Modernization Development
Big Data Technologies - Introduction.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Understanding_Digital_Forensics_Presentation.pptx
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
A Presentation on Artificial Intelligence
NewMind AI Weekly Chronicles - August'25 Week I
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

The Ideas of Clojure - Things I learn from Clojure