small medium large xlarge

Clojure Applied; September PragPub

September 02, 2015

On this day in 1963, CBS introduced the first 30-minute evening news broadcast. Up until then, all the evening news fit into a nightly 15 minute broadcast.

Apparently we have a lot more news now.

And a lot more data, and a lot more tools to deal with data. Tune your toolbox with Clojure Applied: From Practice to Practitioner, now in print and shipping from pragprog.com/book/vmclojeco.

And don't forget this month's PragPub magazine: covering testing from forensic code analysis to the latest on iOS and Swift. Read on for details…

Clojure Applied: From Practice to Practitioner

Clojure Applied gives you the practical, realistic advice and depth of field that’s been missing from your development practice. You want to develop software in the most effective, efficient way possible. This book gives you the answers you've been looking for in friendly, clear language.

Dive into the core concepts of Clojure: immutable collections, concurrency, pure functions, and state management. You'll finally get the complete picture you've been looking for, rather than dozens of puzzle pieces you must assemble yourself. First, explore the core concepts of Clojure development: learn how to model your domain with immutable data; choose the ideal collection; and write simple, pure functions for efficient transformation. Next you'll apply those core concepts to build applications: discover how Clojure manages state and identity; spread your work for concurrent programming; and create and assemble components. Finally, see how to manage external integration and deployment concerns by developing a testing strategy, connecting with other data sources, and getting your libraries and applications out the door.

Go beyond the toy box and into Clojure’s way of thinking. By the end of this book, you'll have the tools and information to put Clojure's strengths to work.

Q&A with Ben Vandgrift and Alex Miller, authors of Clojure Applied

1. Why did we write Clojure Applied?

When Ben was first getting to know Clojure, he found himself awash in tutorials about syntax, toy example applications, and a few places to start. These things were immensely helpful, and he was grateful to their authors.

Eventually, there came a time when he wanted to apply Clojure to a real-world application. Something for a client. Something production-quality and deployable. The publicly available information grew a bit thin. Ben wanted to learn how to think in Clojure, not just at the function level, but across the board. He wanted to take this beautiful language and apply it to something bigger than a bread box.

Fast forward a couple of years. On several occasions, Ben and Alex had spoken about this problem. They referred to it as the 201 Problem. Programmers who understood the basic syntax and had a fair amount of experience in software development couldn't connect the dots up to a large-scale project in Clojure.

During one of these conversations Alex said, "We need to decrease the angle of the ramp," and the phrase stuck. Clojure is perfectly capable of solving life-size problems – wonderfully and elegantly – but developers needed a few more lines between the dots.

We joined forces on a quest to go beyond the syntax and provide a guide to practical application of the Clojure language.

2. Should the approach that Clojure Applied recommends for application development be considered idiomatic?

Together, we have used Clojure to build a number of applications from small to large. While we believe the style and forms we describe are in wide use, it’s difficult to say what is and isn’t idiomatic, especially among members of an innovative and opinionated community.

Every application is unique, but they share common problems and patterns. Whether you begin with the data structures and push outward, or at the component or subsystem level and slice downward, you’re going to need to make decisions about which processes to push into the background, how to manage state, component life cycles, inter-process communication, etc. There are many common points of decision when constructing an application.

Instead of laying down hard and fast rules, we focus on the Clojure-specific tradeoffs related to each topic. We recommend some practices, introduce several advanced concepts as options, and provide context to help support good decision-making. This approach will apply to all Clojure developers in their professional practice.

Additionally, we try and impress on the readers the flow of Clojure development. Developing in Clojure means adopting some of its values and history. We want them to be able to swim with the current, rather than against it.

3. As a growing community, why call out libraries and tools that may change?

In Clojure Applied, we point out several libraries that we use regularly for communication, configuration management, validation, and other functionality most applications will need. Yes, they may change, and our recommendations might change with them. That’s the nature of open source software. We have chosen libraries that are useful right now.

Over time, we might choose differently. Other tools may come to the fore.

When that happens, we’ll update the readers via and through digital updates and future editions. Clojure is mature for its age, but much of its ecosystem is still a moving target. As authors and contributors, we have to move with it.

Our goal was to provide a leg up, a good start. A talented software developer will do their own homework and make their own choices around tooling. It’s nice, however, to have a few places to start. As we mentioned earlier, our goal is to decrease the angle of the ramp. It’s equally important that we don’t try and reinvent wheels—especially early in our practice when learning a new language.

4. Any final words?

Solving a life-size problem is entirely possible in Clojure—simpler, in fact, than it would be in many other languages. Getting to that point from bare syntax is the journeyman's tale. We've had the good fortune to work alongside many skilled Clojurists, and learn from their examples.

Not everyone is this lucky, and so we're passing on our hard-won knowledge. This is why we’ve written Clojure Applied. We hope you enjoy the journey, and we'll see you on the other side.

Now available from pragprog.com/book/vmclojeco.

September PragPub Magazine

Adam Tornhill suggests you view your code as a crime scene (pragprog.com/book/atcrime). Testing has a lot in common with forensic science, and when you’re doing it you may find yourself thinking like a bad guy—or like a clueless user. Today, when you might be developing apps for a spectrum of mobile devices or building a high-traffic always-on ecommerce site, deploying in the cloud and tapping into remote web services or writing robot-control software for a single-board computer, the detective work of software testing is getting more diverse and subtle.

This month in PragPub we have two articles on testing, and links to almost two dozen more.

Keith Stobie focuses on testing for mobile development. Mobile app development is one of the main fields of software development today, and will just get bigger tomorrow. Testing is critical, but is often given inadequate attention in mobile development. Keith addresses this problem with a crash course in testing for mobile development.

If Keith has staked out the low end of the spectrum of platform and app size, Ryan Neufeld makes the other end of the spectrum his own. He explains simulation testing, an approach ideally suited to large-scale production systems generating tons of revenue, where the stakes are high.

We’ve been publishing articles on testing since 2009, nearly two dozen articles. In this issue we link to all of them, from an introduction to TDD from Jeff Langr to articles on testing for iOS, the cloud, web services, and the Arduino.

Also in this issue: Johanna Rothman and Andy Lester offer advice on hiring, Marcus Blankenship gives some tips to the developer recently given management responsibilities, and James Bonang concludes his series on teaching kids to code. We’ve got a bit of Swift code, a roundup of new programming books, and a puzzle.

So welcome to this issue of PragPub.

Now available from theprosegarden.com.

Upcoming Author Appearances

  • 2015-09-08 Adam Tornhill, Swanseacon, Swansea, Wales, UK
  • 2015-09-09 Johanna Rothman, SQGNE
  • 2015-09-17 Chris Adamson, CocoaConf Boston
  • 2015-09-18 Chris Adamson, CocoaConf Boston
  • 2015-09-23 Mattias Skarin, Upphandla IT, Göteborg
  • 2015-09-24 Alex Miller, Strange Loop – St. Louis, MO
  • 2015-09-29 Jesse Anderson, Strata NYC
  • 2015-09-29 Johanna Rothman, Agile Cambridge
  • 2015-09-30 Johanna Rothman, Agile Cambridge
  • Don't Get Left Out

    Are your friends jealous that you get these spiffy email newsletters and they don't? Clue them in that all they need to do is create an account on pragprog.com (email address and password is all it takes) and select the checkbox to receive newsletters.

    Are you following us on Twitter and/or Facebook? Here's where you can find us and keep up with the latest news and commentary, and occasional discounts:

    Tell your friends! Tweet this

    Follow us on Twitter: @pragprog, @pragpub, Andy @PragmaticAndy and Dave @pragdave.

    Coming Soon:

    • Modern Perl, 4th Ed.
    • Learn Game Programming with Ruby: Bring Your Ideas to Life with Gosu in print
    • Web Programming with Phoenix in beta
    • iOS 9 SDK Development: Creating iPhone and iPad Apps with Swift in beta

    Recently Released:

    Thanks for your continued support,

    Andy & Dave The Pragmatic Programmers

    Books • eBooks • PragPub Magazine • Audiobooks and Screencasts
    PragProg.com