A Joyful Introduction To Clojure: Part III

<< Part II

When you’re learning a new programming language, the language itself is only half the battle.

Most language tutorials focus heavily on the features of the language itself, which neglects the other half of the story: To get REAL work done, you also need to know the ecosystem of tools surrounding the language.

You, the first time you try to build a non-trivial application in an unfamiliar language

Now that you’ve learned some of the fundamentals of Clojure in Part I and Part II, it’s time to get our hands dirty with application development.

We’re going to be creating a revolutionary new kind of application…

…a URL-shortening service.

Hey, don’t look at me…

A Joyful Introduction to Clojure, Part II

<< Part I Part III>>

Photo credit: kryshen.net/photos/

Now that we have our development environment set up, we can actually get to work and build something in Clojure.

In this article, I’ll be assuming that you’ve already gone through part I of this guide, so you should already have the joyful_clojure example repository on your local machine. If you haven’t gone through part I yet, now would be a good time.

If you forked and cloned the repository, make sure you get the most recent version by doing the following:

cd /path/to/joyful_clojure
git pull upstream master

If you downloaded the repository as a…

A Joyful Introduction to Clojure, Part I

Part II >>

One of the hardest things about getting started with Clojure is setting up a development environment that allows you to get the most out of the language with a minimum of fuss.

For starters, you have to choose an editor. The most popular choices in the Clojure world are Emacs, Vim, and IntelliJ. Most Clojure tutorials will recommend one of these, because the ecosystem of Clojure tools and plugins around these editors is extremely high quality and mature.

We’re not going to use those. Instead, we’re going to use Atom, because

  1. It is extremely straightforward to download…

Be not afraid of gowing slowly, be afraid only of standing still.

Happy 2017! What’s your new year’s resolution? If you’re like many people, you might have set up a resolution for this year, like “I’m going to lose weight!”, or “I’m going to enjoy life to the fullest!”, whatever that means.

And, if you’re like many people, you have probably made some new year’s resolutions in the past, and then failed to meet them. Too often, we set out to achieve some huge goal that we think will make huge difference in our lives. In the early days, we…

Business and politics have a wholesome and an unwholesome interface. You have to eliminate the unwholesome interface. ~ Salman Khurshid

In the last article, I discussed the technique of dependency injection as a practical strategy for making our code easier to test and refactor. This time around, I’d like to dig in a little farther and show a larger scale example in order to demonstrate how dependency injection is really used in practice.

But first, to provide some context, let’s talk about a very far-reaching and important topic in software development: Interfaces.


Last time, I described dependency injection as follows:

Three Rules of Work: Out of clutter find simplicity; From discord find harmony; In the middle of difficulty lies opportunity ~ Albert Einstein

As someone who builds software, I find myself thinking a lot about how to organize my code. Good quality code organization is one of the main factors that makes a large software system flexible, easy to change, easy to reason about, and easy to test. …

Why should I care about this, anyway?

In my last article, I discussed a particular strategy that I use when I am trying to design a recursive algorithm to solve a problem. I definitely recommend reading that article before this one, but to briefly summarize, here is the strategy:

  1. Break the problem I am trying to solve down into a problem that is one step simpler
  2. Assume that my function will work to solve the simpler problem — really believe it beyond any doubt
  3. Ask myself: Since I know I can solve the simpler problem, how would I solve the more complex problem?

Last time, I applied…

Computer science is no more about computers than astronomy is about telescopes.

About a year ago, I was introduced to the Ruby programming language for the first time. As I was reading about some of the reasons why people like to use it, one adjective kept coming up over and over again: expressive”.

At the time, I was most comfortable with the Python programming language, and if you have any familiarity with Python, you know that its syntax prizes explicitness above all else. As the Zen of Python says, “Explicit is better than implicit”.

For this reason, I was somewhat…

I have frequently heard people new to programming express that they have difficulty understanding how to write recursive algorithms. Although they understand what recursion is, they find difficult to understand how to go about creating a recursive solution. In this article, my goal is not to discuss in detail what recursion is — instead, I would like to discuss how to do recursion — that is, how to think through the process of writing a recursive algorithm to solve a problem.

When talking about writing recursive functions, most people focus on the fact that any recursive function needs to have…

Daniel King

Professional Software Engineer and Educator, amateur Musician, armchair Personal Finance Expert

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store