From OO to Clojure Workshop!
Watch my free workshop to help you learn Clojure faster and shift your paradigm to functional.
Service upgrades and versioning
Growth and breakage
For the most freedom to change, prefer required arguments and optional return values.
The User Wizard Scenario
We start with a Haskell type that models a feature very well. As the feature changes, the data model eventually evolves into something like Clojure's hash maps. Discussion follows.
The Surprising Benefits of Automation
The benefits of automation are not limited to saving time. We go over many advantages, some pitfalls to avoid, and some principles to follow.
3 Things Java Programmers Can Steal from Clojure
Many of the cool parts of Clojure are written in Java. That means you can access those parts from any Java code. Just include the Clojure JAR, import the classes, and you've got better tools.
Recommendations for Next-Level Clojure
There are many classics of functional programming that can help you take your thinking to the next level. My recommendations are for making you think in a new way.
Why does Clojure's conj add to the end of vectors but the beginning of lists?
conj can be confusing if you're used to other languages. It is not a commonly defined operation. Most languages define common positional adding operations. conj, however, has more useful semantics. How do you use conj usefully if you can't guarantee the position?
Try Three Times in Clojure
Distributed systems fail in indistinguishable ways. Often, retrying is a good solution to intermittent errors. We create a retry macro to handle the retries in a generic way.
What is Clojure?
Clojure is a general purpose programming language designed for the fast-approaching future.
Willy Wonka and the core.async Guidelines
There are a few conventions in core.async that are not hard to use once you've learned them. But learning them without help can be tedious. This article presents three guidelines that will get you through the learning curve.
The 100 Most Used Clojure Expressions
Would you like to optimize your learning of Clojure? Would you like to focus on learning only the most useful parts of the language first? Take this lesson from second language learning: learn the expressions in order of frequency of use.
A reduce Example Explained
A deep-dive into a single reduce example shows how much can happen in a short bit of code.
Are there any DOM manipulation libraries in ClojureScript?
ClojureScript has some nice DOM manipulation options, including jQuery and more idiomatic libraries.
What is ClojureScript?
Some Annotated clojure.core/reduce Examples
reduce is a very useful function. You can use it for many calculations over a collection. Code annotations are useful, as are physical metaphors.
Clojure Web Security
Use the OWASP Top Ten Project to minimize security vulnerabilities in your Clojure web application.
React: Another Level of Indirection
React provides a better abstraction over the DOM than MVC frameworks ever can. React is the last piece of the puzzle for ClojureScript web frontend development.
SOLID Principles in Clojure
The SOLID principles are guidelines for writing good Object-Oriented code. It turns out that these principles are followed and embodied in Clojure.
3 models of software development as a factory
Agile software development came from borrowing processes and ideas from manufacturing. Is software engineering like factory work? I examine three metaphors of software engineering as a factory.
A Model of Interceptors
Clojure Error Messages are Accidental
I've recently shifted my thinking about Clojure error messages. It is more useful to think of them as non-existent than to think of them as bad. We end with the role Spec can play in improving error messages.
Clojure vs. The Static Typing World
Rich Hickey explained the design choices behind Clojure and made many statements about static typing along the way. I share an interesting perspective and some stories from my time as a Haskell programmer. I conclude with a design challenge for the statically typed world.
Programming Paradigms and the Procedural Paradox
I break down two perspectives (their features and their methodologies) for the three most common paradigms. I also explore why paradigms are so easy to argue about, and what we can do about it.
Can I do FP in my language?
We address the question directly, but then look deeper to the beliefs behind the question.
Moving Average in Lodash
We write a clean, readable, functional implementation of Moving Average with Lodash.
6 things Reacters do that Re-framers avoid
Down on React? You should check it out from the ClojureScript perspective.
Why Re-frame instead of Om Next
I had to choose between Re-frame and Om Next when building a course. Here are the reasons why.
When in doubt, refactor at the bottom
We explore when it is safe to extract out an abstraction and when you need to go deeper and rebuild it from scratch.
What is an abstraction?
We explore some of the background behind the meaning of the word abstraction and why we do it.
What should a Clojure framework look like?
After exploring why frameworks and why not frameworks, I dive into the design priorities I think a web framework should have.
The arguments against web frameworks
We explore three arguments against frameworks, address them, then turn them into challenges to be overcome.
Why do we use Web Frameworks?
While contemplating a Clojure web framework, I explore the reasons we use web frameworks in general. I conclude that the framework should support a learnable development process.
Should Cognitect do More for Clojure?
Poor open-source development practices, neglect for the beginner experience, and lack of communication have come up as complaints against how Cognitect stewards Clojure. I address the complaints with a plea that we do more as a community.
Why Functional Programming?
There are many reasons to learn Functional Programming. I go over my 11 favorite reasons. Reason #1 is it's fun!
The Bootstrapping Mindset
One of the great things about very robust and powerful abstractions is that they can give you tremendous leverage. The leverage can be so great that you can build something much greater than the sum of its parts. However, I worry that the web is an end to this kind of abstraction. I'd like to explore why that is and what we can do about it.
Wrangling Clojure Stacktraces
Clojure error messages and stacktraces are the number one most complained-about feature of Clojure. We look at some tips and resources for dealing with them.
Clojure's unsung heroics with concurrency
People know about the immutable data structures and the STM. But there's something going on at a much deeper level that is really hard to get right in Java. It has to do with the optimizations the JIT will run on your code.
JVM JIT Optimizations
The JVM JIT is a highly optimized compiler. I present some resources for learning what it does.
JVM Deployment Options
When you're working at a company, you usually inherit their deployment system. And that's great because then you just do what they do. But what if you are on your own? What are the options for deploying a Clojure server?
How do Clojure Programmers Deal with Long Startup Times
Clojure startup times suck. Let's just be honest. How do Clojure programmers live with that? Maybe that's the wrong way to think about it.
Why Clojure starts up slowly — is it really the JVM?
One of the most common complaints about the JVM is the long startup time. But what is really taking so long? We analyze some commands to find out.
Problems with the JVM
The JVM is great but far from perfect. Here are some problems with the JVM that Clojure has to work around.
Java Generational Garbage Collection
The JVM's garbage collector allows for Clojure's persistent data structures to be practical. It's one of the benefits of being a hosted language: you can take advantage of the millions of dollars invested into the JVM's development.
Tricks for Java interop
There are several features of Java that generate weird classnames. We look at how to refer to them from Clojure.
Clojure is a better Java than Java
How is it possible that Clojure is better than Java at its own game? Hear me out, then decide for yourself.
Clojure's Hosted Legacy
Clojure was designed as a hosted language. So what is Clojure, the language, if it relies on the features of a host? And what are the disadvantages of choosing the JVM as a host?
The Idea of Lisp
How a programming language can be an idea.
Building Composable Abstractions Rehearsal 3
My third rehearsal for my upcoming Clojure/conj talk.
Two rehearsals for my Clojure/conj talk
My upcoming Clojure/conj talk is fast approaching. I recorded two rehearsals in two days. Watch them!
New Orleans Clojure Workshop Retrospective
We organized a Clojure workshop. Here's what went right and what we should do next time.
Concurrency and Parallelism in the Real World
Concurrency and parallelism are concepts that we make use of every day off of the computer. I give some real world examples and we analyze them for concurrency and parallelism.
What my daughter's blocks teach us about learning
My daughter's blocks taught her to match shapes with a lot of fast feedback. Fast feedback is a powerful tool to learn any skill. I analyze how the blocks helped my daughter learn and compare it to learning Clojure.
Master one skill at a time
Research shows that developing mastery of a large skill is best done by mastering smaller skills that you can achieve 90% accuracy in very quickly. LispCast Introduction to Clojure has broken the skills you need down for you.
Practice as soon as possible
Much of the difficulty of learning a new language is caused by knowing more than you are comfortable doing. It's so important to get started practicing real programming as soon as possible.
The Importance of Embodied Metaphors
LispCast Introduction to Clojure teaches Clojure with an "interactive bakery simulation". The reason is that metaphors that you can embody are a great way to learn abstract things like programming.
Why I start teaching Clojure with Imperative Programming
LispCast Introduction to Clojure starts with 30 minutes of imperative programming. We write programs for their effects, so imperative is a great place to start.
What are macros?
Macros are one of the most talked about features of Lisp. They are a powerful way to extend the language without modifying the compiler.
Locks vs Concurrency Primitives
Many people have asked me why Clojure has concurrency primitives. Aren't locks good enough? A humorous metaphor is elaborated.
How can more layers be more efficient?
It's common that adding more layers of abstraction or indirection will make things slower. However, React and ClojureScript make web pages faster than doing it by hand — essentially programming the bare web. The lesson is that if you choose your layers well, they can actually make your system faster.
Reasoning About Code
Functional programmers often use the term "reason about code". It's not very well defined generally, but I use it myself to refer to our ability to use our real-world intuition in our own code.
Immutable data appear to contradict our observations of the real world. Things in the world are mutable, so shouldn't our data be mutable, too? It may be counterintuitive, but immutable data does a better job of modeling many of our expectations of the real world.
Composition is an important idea in programming, and Functional Programming brings it to the forefront. But what does it mean to say things are composable?
Global Mutable State
Global mutable state is one of the biggest drivers of complexity in software systems. We tackle a definition and how to reduce our reliance on it.
How to Switch from the Imperative Mindset
Functional programming, from one perspective, is just a collection of habits that affect our programming. I've identified the cues for those habits and a routine for replacing imperative code with functional code.
Clojure + Ruby
If you're a Rubyist and you've heard some buzz about Clojure, these videos and links will be just for you. Rubyists teaching Clojure, Clojurists introducing Clojure to Ruby programmers, and Rubyists pontificating on Clojure.
2 Features of Clojure Editors Professionals Won't Do Without
Professional Clojure programmers rely on certain features of their editors to help them program. When choosing an editor, it's important to pick one that has these two important features: REPL integration and structural editing.
I've made some cheatsheets to help me learn clj-refactor, some Emacs software that helps you make systematic changes to code.
What is React?
React is a view library for web pages that makes DOM rendering in a functional style really easy. React makes web programming fun again.
Knowing this one ClojureScript gotcha will save you hours
ClojureScript optimizes names by replacing them with shorter ones. Usually, that's a good thing. But it can get carried away. Externs are how you help it know what's unsafe to optimize.
Will having ClojureScript, yet another asset type, slow down my deploys?
ClojureScript builds can take a long time. But the extra time is worth it. It reduces the download size significantly.
The Most Important Idea in Computer Science
Computer Science has ideas that are important to the broader world. The most important is the Universal Turing Machine. From one perspective, Lisp embodies the idea at its core. To really understand how, I ask you to implement your own Lisp interpreter.
Let's TDD clojure.core/map
Learning to write map is a good lesson because it has recursion, list building, and higher order functions. It's everything that makes Lisp great.
map is one of the staples of functional programming. It's totally useful and also surprisingly simple. Let's look at some examples and annotated code.
Reduce Complexity with Variants
The structure of our data should match the relevant structures in the real world. And to ensure that our data is structured well, we should reduce the potential for incorrect structure. Variants provide a great solution for it.
Avoid Naming at All Costs
If naming is one of the two hardest things in programming, it follows that every other possible solution (except those few involving cache invalidation) should be attempted before naming something. As a corollary, bad names are a code smell.
Mastering ClojureScript Routing with Secretary and goog.History
The Google Closure Library provides a nice interface to the HTML5 History API. Coupling it with Secretary is very easy. But not all browsers support HTML5 History. In this post I'll talk about one way to make sure you have client-side routing in all browsers.
Lambda abstractions are always leaky, but some are leakier than others. Clojure programmers recommend keeping most of your functions pure and containing the leaks as much as possible.
But the World is Mutable
The world may be mutable, but people have been using the notion of immutability to build reliable systems for a long time.
I made a clojure.test cheatsheet that you can get for free.
Pre-West Prep: Zachary Kim
Zachary Kim will talk about mobile development in Clojure.
Pre-West Prep: Sean Johnson
Sean Johnson will talk about pattern matching.
Pre-West Prep: Soren Macbeth
Soren Macbeth will talk about data crunching in Clojure.
Pre-West Prep: Timothy Gardner and Ramsey Nasser
Timothy Gardner and Ramsey Nasser will talk about Arcadia.
Pre-West Prep: Dan Lidral-Porter
Dan Lidral-Porter will talk about computer-generated art in Clojure.
Pre-West Prep: Boris Kourtoukov
Boris Kourtoukov will talk about Clojure and wearables.
Pre-West Prep 2015
Prepare for Clojure/West with media from around the web and interviews.
A common failure in distributed systems is a server with a rate limit or with no limit but begins failing due to load. A standard solution is to retry after waiting a small time, increasing that time after each failure. We create a macro to handle this waiting and retrying.
How to avoid "Makes sense if you already understand it."
Most technical writing is obtuse unless you already know the topic. Focus on the learner and their skills and it will clarify your writing.
Object-Oriented Dispatch is the Dual of Functional Dispatch
Object-oriented dispatch is contrasted with functional dispatch, but they are shown to be two one-dimensional projections of the same two-dimensional data. Clojure does not provide the two-dimensional representation, but does interesting things to transcend the one-dimensional views.
Solarized Cheat Sheet
Solarized is an awesome color scheme that I use all the time. I was tired of looking up the hex codes, so I made my own cheat sheet. You can download it.
Use Task Analysis to Break a Skill Into Steps
Many technical books skip very important skills you need to complete a task. To avoid skipping those skills, use task analysis to break a skill into steps.
If something is important, you should deal with it sooner and more often. That's the approach Clojure takes to data representations. It means serialization of internal data is a non-issue.
The Paper Metaphor
Functional programs follow a simple rule: never write on the same paper twice. Imperative programs are free to define their own rules. Both have interesting consequences.
PurelyFunctional.tv Early Access Program
The PurelyFunctional.tv Early Access Program is a way to make courses in a more iterative and interactive way. I'll be publishing Intro to clojure.test this week under PEAP.
Announcing: LispCast Intro to clojure.test
The next course will be about clojure.test. Sign up to be notified when it is published.
New Course Format
LispCast video courses have a new, interactive format. It's easier for me to make courses (read: more, faster) and it's a better experience for learners.
The Parts of Ring
Ring, the Clojure Web library, defines three main concepts that you use to construct web applications.
Object-Oriented Programming is the Dual of Functional Programming
How to Write Software
Writing software alone and in a long term sustainable manner requires a lot of discipline. Upfront planning and avoidance of feature creep can turn a stressful project into a pleasure.
Data > Functions > Macros. But why?
"Prefer data over functions" is a common adage in Clojure circles. It is poorly debated because it is a terse statement in generalities. A valuable perspective is that data is transparent at runtime, while functions are not. This perspective gives a firm ground for discussion and design.
Pre-conj: Scheme Workshop
Jason Hemann talks about the Scheme Workshop.
Elm FRP in Clojure core.async
Elm is an exciting FRP language. I implemented the FRP part in Clojure using core.async.
Conveyor Belts: Nature's core.async Channels
Conveyor belts are strikingly similar to Clojure core.async channels. While it could be a coincidence, there is speculation that conveyor belts were influenced by a deep understanding of core.async.
Token Buckets with core.async
Token Bucket is a simple algorithm for rate limiting a resource. It's easy to understand because you can reason about it in terms of real-world objects. core.async makes this algorithm very clear and easy.
Pre-Conj Interview: Colin Fleming
Colin Fleming interview about Cursive Clojure.
Pre-conj Prep: Nathan Herzing and Chris Shea
Nathan Herzing and Chris Shea will talk about Pedestal, Om, Datomic, and core.async.
The Content of Your Code
Code style is important, but way less important than content. Yet everyone talks about style because it's easier. Let's talk about content.
Pre-conj Prep: Jeanine Adkisson
Jeanine Adkisson will give a talk about Variants in Clojure at the Clojure/conj 2014.
Pre-conj Prep: Rich Hickey
Rich Hickey will talk about Transducers.
Pre-conj Prep: Glenn Vanderburg
Glenn Vanderburg will talk about implementing the TeX algorithms in Clojure.
Pre-conj Prep: Colin Fleming
Colin Fleming will talk about Cursive Clojure.
Pre-conj Prep: Brian Goetz
Brian Goetz will give the keynote at Clojure/conj.
Pre-conj Prep 2014
Prepare for the Clojure/conj with media from around the web.
Just Hack Something Together
Lisp is viewed as difficult and academic but it is a great language for hacking a solution together.
Two Kinds of Bootstrapping
I like languages with a small core that is extensible. The languages tend to be weird and require less code to bootstrap.
Clojure is Imperative
Clojure is an imperative language. Its operations are defined in terms of concrete actions. But those actions are often the same actions available to the programmer at runtime. This makes it easy to bootstrap.
Lisps are revered for their simple syntax, but parens are complex. They complect function calls and macro calls, which have drastically different semantics.
Is core.async Against the Clojure Philosophy?
Clojure core.async is a way to manage mutable state. Isn't that against functional programming?
Reification means making an abstraction into a concrete value that can be manipulated at runtime. Reification is the core of what makes a language dynamic. Three types of reification in Clojure are discussed.
core.async in Browsers
Stop Refactoring and Start Factoring
Refactoring is focused on the quality of code, while factoring aims to uncover the underlying beauty of the problem domain, as expressed in code. Instead of cleaning up your code, try factoring.
Church vs Curry Types
Static vs dynamic typing debates often flounder because the debators see from two different perspectives without knowing it. Learning to identify the two perspectives can calm the discussion. The tension between the two perspectives has led to Gradual Typing and other technologies.
What is Functional Programming?
I prefer to define Functional Programming as making a distinction between pure and impure code. With this definition, you can program functionally in any language. What differentiates the functional languages is how much help they give you to make the distinction.
CSS and the Lambda Calculus
Using LESS, we can almost achieve the expressive power of the Lambda Calculus as applied to styling. The expressive power is enough to create reusable styles applied to reusable HTML components.
Separation of Presentation and Content
One reason to separate style from content is to reuse HTML or CSS. Ultimately, we would like a solution where we can reuse both.
LESS has Better Forms of Abstraction than CSS
LESS has obviously better forms of abstraction and combination than CSS. It has recursive style definitions, which is enough to consider it a "powerful language".
CSS has Weak Forms of Abstraction and Combination
According to the requirements proposed by Abelson and Sussman, CSS does not provide adequate means of combination and abstraction to be considered a powerful language.
Hindley-Milner in Clojure
I wrote a lambda-calculus interpreter and an implementation of Hindley-Milner to type check it.
Deconstructing Functional Programming
On Type Unity
Languages with strong, dynamic types (like Scheme) are actually single-typed languages, not untyped languages. Some would say this is restrictive, but this unity of type is a source of their strength.
Lisp with Macros is Two Languages
Lisp with macros can be seen as two languages, each with different semantics. The base language can be interpreted directly, whereas the result of interpreting the macro language is to produce a new program in the base language.
Making True/False Questions Easy
Use Your Imagination
You can transfer the outline of a skill by guiding someone through a structured use of their imagination.
Nil Punning (Or Null Pointers Considered Not So Bad)
Null pointers are still a problem in Clojure, but several design decisions have made them less problematic than other languages.
Tap Into Your Social Brain
We can solve social problems much more easily than logic problems, even when they are equivalent. Convert a logic problem into a social problem to make it easier to solve.
Why technical explanation alone is not enough
Functors, Applicatives, And Monads In Pictures
Monads and Objects
Monads & Gonads
Separation, Abstraction, and Cascading in CSS
LESS and Sass (and similar solutions) have saved CSS for three reasons: separation, abstraction, and cascading. While I welcome them, CSS still has other problems which I believe can be solved.
The Case Against Curly Quotes
Google Common Lisp Style Guide
Static vs. Dynamic Typing
The Impedance Mismatch is Our Fault
On the configurations of data and functions
The Datomic Architecture and Data Model
The DCI Architecture: Lean and Agile at the Code Level
Deferring Type Errors to Runtime
Why should I have written ZeroMQ in C, not C++ (part II)
Monads in Pictures
Faith, Evolution, and Programming Languages
Dynamic Languages Wizards Series - Panel on Language Design
How The JVM Spec Came To Be
I remember the time before monads
JSON and Algebraic Data Types
Notes from the Mystery Machine Bus
Extreme Cleverness: Functional Data Structures in Scala
PDF version of Structure and Interpretation of Computer Programs
Knockbox, an Eventual Consistency Toolkit
How to answer a question: a simple system
Your Coding Philosophies are Irrelevant
Programming Languages and Piaget's Stages of Cognitive Development
Why is a Monad Like a Writing Desk?
The future is specific
Ambrose Bonnaire-Sergeant Interview about Typed Clojure
An Interview with Game Developer James Hague
Simplicity Matters by Rich Hickey
How to Write Clean, Testable Code
Google Python Style Guide
Review: Clojure Programming by Chas Emerick, Brian Carper, and Cristophe Grand
(take 5 daniel-spiewak)
Clojure 1.4 Reader Literals Test
Introduction to Haskell talk
ThinkRelevance: The Podcast - Episode 009 - Alan Dipert
NeXT, OpenStep, and the Return of Steve Jobs to Apple
Rich Hickey: Keynote
Introduction to Logic Programming with Clojure
Programming Paradigms and Expressive Power
Osterhout's Dichotomy Isn't
Indirection Mechanisms and Expressive Power
Programming Language Checklist
Modern Language Wishlist
Escape from the Ivory Tower
Parser Combinators: How to Parse (nearly) Anything
apple == orange
Programming and Scaling
The future of programming
The Coming War on General Purpose Computation
Ring 1.0.0 Released
Clojure for dummies: a kata
A Short Ballad Dedicated to the Growth of Programs
The Heart of Unix
Seesaw REPL Tutorial
Tips for using marginalia
Waving Our Tentacles
13 hours of Lisp
My personal notes from the Lisp50 event at OOPSLA 2008.