small medium large xlarge

Getting Clojure: Build Your Functional Skills One Idea at a Time

by

Cover image for Getting Clojure

Getting Clojure

Build Your Functional Skills One Idea at a Time

by

Behind every programming language lies a vision of how programs should be built. The vision behind Clojure is of a radically simple language framework holding together a sophisticated collection of programming features. Learning Clojure involves much more than just learning the mechanics of the language. To really get Clojure you need to understand the ideas underlying this structure of framework and features. You need this book: an accessible introduction to Clojure that focuses on the ideas behind the language as well as the practical details of writing code.

Customer Reviews

At long last, Russ Olsen brings his engaging and encouraging style to the Clojure landscape. I wish Getting Clojure had been available when I was learning the language. If you’re looking for a smooth transition into Clojure, this is it.

- Ben Vandgrift

Chief Architect, Orxy Systems, Inc.

The book was a joy to read and is highly recommended due to its comprehensive scope and brilliant writing. It also showcases the spirit of the Clojure community: a deeply knowledgeable but also informal, exploratory, no-nonsense approach to thinking about software.

- Tibor Simic

Software Developer, Inge-mark

My favorite sections in the book: “In the Wild”—code that is live and used today. Seeing real code immensely propelled my understanding of the materials, far beyond any contrived examples. I wish I had this book five years ago!

- Nola Stowe

Software Engineer, Condé Nast

Let Russ Olsen’s destructuring of Clojure map mind-twisting concepts into a promise of your bright future as a capable functional coder.

- Stefan Turalski

Software Developer, BNP Paribas

The perfect initiation into the world of Clojure.

- Scott Downie

VP Support and Services, Illumio

See All Reviews

Choose Your Format(s)

  • $49.95 In Stock

    Save $15.95 on the combo pack.

  • $39.95 In Stock
  • $25.95 In Stock
  • Ebooks are DRM free.

  • Ebook delivery options.

About this Title

Skill-meter-5-8
Pages: 288
Published: 2018-05-09
Release: P1.0 (2018-05-08)
ISBN: 978-1-68050-300-5

Clojure attracts developers on the cutting edge and is arguably the best language for learning to program in the functional style without compromise. But this comes with a steep learning curve. Getting Clojure directly addresses this by teaching you how to think functionally as it teaches you the language. You’ll learn about Clojure’s powerful data structures and high-level functions, but you’ll also learn what it means for a language to be functional, and how to think in Clojure’s functional way.

Each chapter of Getting Clojure takes a feature or two or three from the language, explains the syntax and the mechanics behind that feature so that you can make it work before digging into the deeper questions: What is the thinking behind the feature? And how does it fit in with the rest of the language? In Getting Clojure you’ll learn Clojure’s very simple syntax, but you’ll also learn why that syntax is integral the way the language is constructed. You’ll discover that most data structures in Clojure are immutable, but also why that leads to more reliable programs. And you’ll see how easy it is to write Clojure functions and also how you can use those functions to build complex and capable systems.

With real-world examples of how working Clojure programmers use the language, Getting Clojure will help you see the challenges of programming through the eye of experienced Clojure developers.

What You Need

You will need to some background in programming. To follow along with the examples in the book, you will need Java 6 or new, Clojure 1.8 or 1.9, and Leiningen 2.

Contents & Extracts

  • Basics
    • Hello, Clojure excerpt
      • The Very Basics
      • Arithmetic
      • Not Variable Assignment, but Close
      • A Function of Your Own
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Vectors and Lists
      • One Thing After Another
      • A Toolkit of Functions
      • Growing Your Vectors
      • Lists
      • Lists versus Vectors
      • Staying Out of Trouble
      • In the Wild
      • Wrapping Up
    • Maps, Keywords, and Sets
      • This Goes with That
      • Keywords
      • Changing Your Map Without Changing It
      • Other Handy Map Functions
      • Sets
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Logic
      • The Fundamental If
      • Asking Questions
      • Truthy and Falsy
      • Do and When
      • Dealing with Multiple Conditions
      • Throwing and Catching
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • More Capable Functions
      • One Function, Different Parameters
      • Arguments with Wild Abandon
      • Multimethods
      • Deeply Recursive
      • Docstrings
      • Pre and Post Conditions
      • Staying Out of Trouble
      • In the Wild
      • Wrapping Up
    • Functional Things excerpt
      • Functions Are Values
      • Functions on the Fly
      • A Functional Toolkit
      • Function Literals
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Let
      • A Local, Temporary Place for Your Stuff
      • Let Over Fn
      • Variations on the Theme
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Def, Symbols, and Vars
      • A Global, Stable Place for Your Stuff
      • Symbols Are Things
      • Bindings Are Things Too
      • Varying Your Vars
      • Staying Out of Trouble
      • In the Wild
      • Wrapping Up
    • Namespaces
      • A Place for Your Vars
      • Loading Namespaces
      • A Namespace of Your Own
      • As and Refer
      • Namespaces, Symbols, and Keywords
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
  • Intermediate
    • Sequences
      • One Thing After Another
      • A Universal Interface
      • A Rich Toolkit …
      • … Made Richer with Functional Values
      • Map
      • Reduce
      • Composing a Solution
      • Other Sources of Sequences
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Lazy Sequences
      • Sequences Without End
      • More Interesting Laziness
      • Lazy Friends
      • Laziness in Practice
      • Behind the Scenes
      • Staying Out of Trouble
      • In the Wild
      • Wrapping Up
    • Destructuring
      • Pry Open Your Data
      • Getting Less than Everything
      • Destructuring in Sequence
      • Destructuring Function Arguments
      • Digging into Maps
      • Diving into Nested Maps
      • The Final Frontier: Mixing and Matching
      • Going Further
      • Staying Out of Trouble
      • In the Wild
      • Wrapping Up
    • Records and Protocols
      • The Trouble with Maps
      • Striking a More Specific Bargain with Records
      • Records Are Maps
      • The Record Advantage
      • Protocols
      • Decentralized Polymorphism
      • Record Confusion
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Tests
      • Spotting Bugs with clojure.test
      • Testing Namespaces and Projects
      • Property-Based Testing
      • Checking Properties
      • Staying Out of Trouble
      • In the Wild
      • Wrapping Up
    • Spec
      • This Is the Data You’re Looking For
      • Spec’ing Collections
      • Registering Specs
      • Spec’ing Maps (Again)
      • Why? Why? Why?
      • Function Specs
      • Spec-Driven Tests
      • Staying Out of Trouble
      • In the Wild
      • Wrapping Up
  • Advanced
    • Interoperating with Java
      • A Peek at Java …
      • … And Back to Clojure
      • Packages
      • Class Methods and Fields
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Threads, Promises, and Futures
      • Great Power …
      • … And Great Responsibility
      • Good Fences Make Happy Threads
      • Promise Me a Result
      • A Value with a Future
      • Staying Out of Trouble
      • In the Wild
      • Wrapping up
    • State
      • It’s Made of Atoms
      • Swapping Maps
      • Refs: Team-Oriented Atoms
      • Agents
      • Choose Wisely
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Read and Eval
      • You Got Data On My Code!
      • Reading and Evaluating
      • The Homoiconic Advantage
      • An Eval of Your Own
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Macros
      • There Are Three Kinds of Numbers in the World
      • Macros to the Rescue
      • Easier Macros with Syntax Quoting
      • In the Wild
      • Staying Out of Trouble
      • Wrapping Up
    • Conclusion

Author

Russ has been building software for the last 35 years, everything from engineering document management to database query engines. Russ has been on a career long quest to find a better programming language and was an early adopter of Python, Java, Ruby and Clojure. Russ is the author of two books on Ruby, Design Patterns in Ruby and Eloquent Ruby, and is a prolific conference speaker.