Starting Clojure (mk. 2)

I’ve wanted to put together a long-form introductory Clojure screencast for some time.  I had an opportunity to do this in grand style yesterday in a live O’Reilly webcast, but, for various reasons, I wasn’t fond of how that came together.  So, I cut another live coding screencast that introduces, in various levels of detail:

A complete (though not pretty!) URL shortener webapp is built from scratch, with discussions of immutable data structures, function composition, and mild concurrency topics scattered throughout.  It’s a fair bit more than I was planning on covering in the O’Reilly webcast, but I think the additional material blended in well.

Without further ado, Starting Clojure, mk. 2:

(You may want to watch full screen in HD to see various details)

Once you’re done with the screencast, you may want to continue your Clojure explorations with the help of Clojure Programming, and maybe Clojure Atlas (which, conveniently enough, is available at a hefty discount with your copy of  Clojure Programming).

Backstory on the O’Reilly Starting Clojure webcast

Ever had a bad day? Sure, of course. Ever had a really bad day prior to presenting a live-coding webcast to what turned out to be ~700 internet attendees?  Yeah, that was me yesterday. If you’re brave (or want to wince, laugh, and then cry at my performance), you will likely be able to see the video of it eventually. But seriously, don’t bother.

I probably should have postponed the whole thing, but that seemed unreasonable at the time — the fact that it had been planned for a couple of weeks, had a bunch of registered attendees, and my own stubbornness urged me on to commit programmer seppuku.  I was existentially distracted the whole time, and the more I tried to hold it together, the worse things got.  (Of course, that’s not an excuse, but an explanation.)  Honestly, after finishing the webcast, I was absolutely horrified; I had a great opportunity to represent Clojure well to a large body of programmers new to the language, and I utterly failed.  I felt like I had done a disservice to O’Reilly and, most of all, my coauthors.

Fight or flight kicked in, and for 5 minutes, I harbored thoughts of giving up doing screencasts and public speaking permanently, to save everyone involved. Thankfully, I relaxed, had a couple glasses of wine, and woke up early this next morning with a clear head to record a live-coding screencast, in proper single-take style, which you see above.  It is epically better than the O’Reilly webcast, covers the material better than I planned, and was marred only by a couple of minor hiccups that were more funny than sad.

That is to say, mk. 2 is entirely in keeping with my usual baseline, and I’m happy to have it out there.  In the end, I hope more people see it than the first webcast I did.  In any case, I’m glad to have gotten back on the horse and hopefully redeemed myself by some measure.

About these ads
This entry was posted in Clojure, Clojure Programming (book). Bookmark the permalink.

28 Responses to Starting Clojure (mk. 2)

  1. frou says:

    Hey – I watched the live version and once it was done, my only negative thought was “that ended up pretty light on content” and not that you had bombed epically. My second thought was that coding with a free flowing chat room in view can never be a good thing!

    Thanks for mk.2. Will check it out.

  2. otfrom says:

    I’ve been there myself (last week in fact). Don’t give up. :-D

  3. I had signed up for the webcast but had to miss it. I tried watching the archived version but didn’t see the video, only the slides. So I’m glad you posted this, I was interested in the material! Looking forward to watching it later.

  4. marivas11 says:

    Thanks for your work and commitment to support clojure community. This video gives more strength to the live version. I do not understand English perfectly so the option of subtitles for youtube is a positive side effect. ;-)

  5. Tebra says:

    I also watched the live version, and it really wasn’t that bad. It wasn’t amazing or anything, but trying to introduce a language in the course of an hour is very difficult. I found that it was a great demonstration of how CCW + Eclipse makes a good dev environment and a nice little demo of the “flavor” of Clojure which is about all anyone could expect in an hour. It sucks various things managed to drag it down a bit so you couldn’t cover everything you might have been able to if it went off without a hitch, but there was enough there that I felt it was worth my time.

  6. Mick says:

    It wasn’t that bad! I really felt for you and put in a vote of confidence with my wallet — ordered your book right after the webcast. Should be arriving today, and am really looking forward to reading it in “dead tree” form (I’ve been reading on O’Reilly Safari and have been enjoying it). Thanks for your hard work.

  7. +1 for someone else who was watching and didn’t think it was a huge bomb. Heck, I even bought your book afterwards, so how’s that for not a failure? I’ll definitely watch mk2 for a refresher though.

    • Chas Emerick says:

      Thanks to you and Mick for picking up the book and being kind in your appraisal of the initial effort. :-) We are all our own worst critics, I suppose.

  8. ozataman says:

    Hey Chas,

    Thanks for the helpful screencast. Any chance you can post the source for the dummy project so we can see it all in one place?

    • Chas Emerick says:

      It’s not a lot different than what we present as a sample web application in chapter 16 of the book. The sample code for the book is here.

      I think the main piece that isn’t in the book example is the integration of enlive templating into the URL shortener app. A more thorough walkthrough on enlive (maybe contrasted with hiccup) would be interesting, and definitely warrant releasing a separate project to go along with it.

  9. rez says:

    Great vid, thank you very much.
    Just a quick note: links #4 and #5 ((the Eclipse Clojure plugin) and Leiningen) need a fix.

  10. Robert Beaupre says:

    Thanks for all of your hard work on teaching Clojure. As someone that has been playing with the language for a while but is still a beginner, the more resources that are out there the better. I appreciate your teaching style and stayed interested for the full hour and a half. I have bought most of the most of the intro Clojure books out there and was hesitant to buy another. The original screencast changed my mind though and I did buy it. I am sure that most people did not have a negative reaction to the first video. We are our own worst critics. As a video that people will come back to, this one is a much better resource. Thanks for taking the time to do the second one.

  11. Markus Jais says:

    Thanks, very cool. Very good screencast. I am also looking forward to use your book to learn more about Clojure. amazon.de just wrote me that it will arrive on Monday. Can’t wait reading it.

  12. pratikrpatel says:

    Chas, I d/l and installed the latest eclipse (actually STS, which is Eclipse 2.91) then installed CCW stable + lein plugin from the update sites, and I can’t get the project to enable clojure support. Can you share which versions of Eclipse/Clojure/Lein/CCW you’re running?

    • Chas Emerick says:

      Eclipse 2.9.1 is awful old. Maybe you mean 3.9.1?

      Anyway, I’m currently using Eclipse 3.7.2, ccw 0.7.0, and the latest of the Leiningen beta plugin. The same configuration works for any version of Clojure 1.2.0 – 1.4.0.

      I would suggest reporting your problem (with accompanying stack traces from the error log, etc?) to the Counterclockwise list, and we’ll see what we can do to help.

      • pratikrpatel says:

        err sorry, Eclipse 3.7.2. I followed the directions from the screencast to install CCW and Lein plugins. Already had the Lein2 beta installed. Failed with an error message complaining something about ‘project description’ when enabling clojure support. What’s weird is I went back, started Eclipse again, created the new project, Convert to Lein, Add CLojure support, and it worked now! WTF? FYI I did restart Eclipse after each plugin’s install… thanks, now back to the screencast :)

  13. Justin Forder says:

    Thank you, I found this screencast really useful, and will come back to it to follow along hands-on.

  14. denisfuenzalida says:

    Nice screencast … I have been learning more Clojure and Noir, it was nice to see how things are done using Compojure and Enlive. Good work!

  15. looselytyped says:

    Hey Chas,

    Let me start by saying that I just finished watching your screencast, and found it immensely helpful – Your pace is perfect, and you cover a lot of ground – Thanks for doing this.

    Just a quick note – but in your code you use ‘pprint’ – and somehow that seems to work in the Eclipse Clojure Repl – but running this code from within emacs does not compile (without explicitly ‘use’ing clojure.pprint within the startingclojure.app namespace) – So I am wondering – is this something that I need to fix, or is clojure.pprint getting pulled in by CounterClockwise behind the scenes?

    Oh! I got your book last week, and really enjoying it. Thanks a lot.

    • Chas Emerick says:

      Thanks for the kind words.

      Yeah, my usage of pprint there was a mistake. The standard Clojure repl (i.e. clojure.repl/repl) implicitly refers clojure.pprint/pprint into the current namespace. nREPL (and therefore Counterclockwise) reuses that, which explains the behaviour in the screencast. AFAICT, swank (the emacs/SLIME analogue to nREPL) does not, and so the explicit refer (or use) is required.

      What I should have done is add a (:use [clojure.pprint :only (pprint)]) clause to my ns form, which would have made the pprint usage work regardless of any REPL implementation details.

  16. James says:

    All right Chas! Didn’t watch the O’Reilly thing but thanks for the YouTube screencast! I’m getting into Clojure and this is very much appreciated. I think I’ll speak for many people if I say “the more efforts like this, the better”. PS. I’ll be ordering your and Christophe’s book pronto!

  17. Pingback: Clojure Eclipse Leiningen Counterclockwise Setup

  18. thekilon says:

    I am afraid I did not understand much from this screencast and I would not recommend to a begineer but its certainly useful for someone already familiar with clojure and it describes a lot of interesting concepts. Thanks for taking the time of making this. I would not call it introductory material, because it take for granted that the viewer knows some if not all of the weird terminology used in the video but its still useful.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s