(why (and  :functional-programming  :clojure):matters)
Why Should You Listen?To learn● Why FP useful for us● Why to learn a "useless" side language● Why Clojure
Why functional programmingmatters?            Proposals?
Functional programming: What,why?● Simplicity: Limit state, side-effects  ○ Referential transparency  ○ Immutable persiste...
You may ask     Why hasnt FP taken the world over yet?
But then we could also ask Why became OOP, available since Simula 67,           only popular in 90s?  (Even though Smallta...
Why Clojure?● Its different   ○ Functional - new paradigm, back-port learnings● Its Lisp - the most powerful language ever...
Lisp is worth learning for the profoundenlightenment experience you will have whenyou finally get it; that experience will...
Clojure: Basic Facts●   Functional language for JVM (and .net, JS)●   Dynamically-typed●   Good Java interoperability●   2...
Clojure Syntax(function arg1 arg2 ...)   (list 1 2 3 4 5)   (+ 1 2 3)   (def square (fn [x] (* x x)))Lists - and thats all...
Example: SQL(defentity person)(dry-run (select person   (where {:name "Bodil" :age [> 18]})   (order :name :ASC)))        ...
Thank you!
Refs● http://stackoverflow.  com/questions/1786969/pitfalls-  disadvantages-of-functional-programming● http://c2.com/cgi/w...
Upcoming SlideShare
Loading in …5
×

Why Functional Programming and Clojure - LightningTalk

934 views

Published on

Lightning talk - why functional programming is worth learning and using and why Clojure is a good functional language to start with.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
934
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Why Functional Programming and Clojure - LightningTalk

  1. 1. (why (and :functional-programming :clojure):matters)
  2. 2. Why Should You Listen?To learn● Why FP useful for us● Why to learn a "useless" side language● Why Clojure
  3. 3. Why functional programmingmatters? Proposals?
  4. 4. Functional programming: What,why?● Simplicity: Limit state, side-effects ○ Referential transparency ○ Immutable persistent data structures ○ STM, agents etc. ○ => concurrency● Higher abstractions, including ○ HOF: More reuse - compose behavior ○ Multimethods: Dispatch on any argument(s)● Language maintains state (lex. scope, loop)● Generic operations on generic data structs● Key design question: What it does?
  5. 5. You may ask Why hasnt FP taken the world over yet?
  6. 6. But then we could also ask Why became OOP, available since Simula 67, only popular in 90s? (Even though Smalltalk is more OO than Java and C++ and available since 81.)It takes time, money, opportunity, optimization, and luck for concepts to takehold.
  7. 7. Why Clojure?● Its different ○ Functional - new paradigm, back-port learnings● Its Lisp - the most powerful language ever ○ Macros - infinite abstraction ○ Write the language fitting the domain first● It runs on JVM ○ Reuse, interoperab., mature and available platform● Designed for concurrency
  8. 8. Lisp is worth learning for the profoundenlightenment experience you will have whenyou finally get it; that experience will make youa better programmer for the rest of your days,even if you never actually use Lisp itself a lot. Eric S. Raymond, "How to Become a Hacker"
  9. 9. Clojure: Basic Facts● Functional language for JVM (and .net, JS)● Dynamically-typed● Good Java interoperability● 2006 started, 2009 v1.0, 2011 v1.3● A Lisp (58) dialect● Emphasis on simplicity● Designed for concurrency ○ STM, agents, immutability, ...● Flexible, extensible● Support for objects● Code <=> data
  10. 10. Clojure Syntax(function arg1 arg2 ...) (list 1 2 3 4 5) (+ 1 2 3) (def square (fn [x] (* x x)))Lists - and thats all!● Well, nearly - also 13 special forms (def, if, let, fn, try, ..)● Few data types: (), [], #{}, {}● Literals: 1, "str", :key, symbol
  11. 11. Example: SQL(defentity person)(dry-run (select person (where {:name "Bodil" :age [> 18]}) (order :name :ASC))) By Bodil Stokke, github.com/bodil
  12. 12. Thank you!
  13. 13. Refs● http://stackoverflow. com/questions/1786969/pitfalls- disadvantages-of-functional-programming● http://c2.com/cgi/wiki? AdvantagesOfFunctionalProgramming● http://c2.com/cgi/wiki?OoVsFunctional● http://c2.com/cgi/wiki?FpVsOo● http://c2.com/cgi/wiki?FunctionalModeling● http://c2.com/cgi/wiki? ArchitectureAndFunctionalProgramming● http://clojure.org/rationale

×