An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

Entries for month: March 2013

My First PyCon

March 17, 2013 ·

Given the incredible focus on children and education in the Python community, I feel like I should be writing this blog post in crayon "My First PyCon By Sean Corfield, Aged 50"...

PyCon 2013 was my first exposure to the Python community and, beyond some Python 101 for the 10gen MongoDB for Developers course, which I took late last year, my first real exposure to what Python is all about. Color me impressed on both counts!

As I've mentioned before, I try to learn a new language every year or two, hopefully in enough detail to take it to production in some way. Python's been on my list for a while and, as I blogged back in October, 2013 is my year to learn Python! I don't expect to be building applications with Python but I do hope to streamline our build system at work over time to get rid of the ad hoc mix of bash scripts and ant tasks (our 800 line build.xml is already getting pretty painful to maintain because ant is not really designed for conditional logic and loops... and, frankly, XML is not a programming language!).

PyCon 2013 had 2,500 people signed up and the exhibitor hall was packed with a lot of companies I'd heard of and a lot of companies I had not heard of, but everyone was overwhelmingly friendly and positive and the vibe was very much an inclusive community - everyone is welcome, from young to old, from all around the world, from every walk of life - and it was certainly the most diverse technical conference I have ever attended which made a wonderfully refreshing change! At every break and lunch, I struck up conversations with new people and over and over again I heard that "Python is awesome!" and the "Python community is awesome!". The Python Software Foundation flew a ten year old boy and his father from South Africa so the boy could be a Teaching Assistant at the pre-conference workshop for kids to learn Python programming. One of the keynote speakers brought his two(?) year old kid up on stage - wearing a Python T shirt - and I saw several parents with children at the conference, as attendees. Getting kids into programming at such young ages is awesome. Every attendee was offered a Raspberry Pi and we were told that all the spare ones that attendees didn't want would be donated to school programs and similar outreach. In addition to the unusual sight of children at a tech conference, there were also far more women at PyCon than I've ever seen at a tech conference, with booths occupied by PyLadies, Women Who Code, CodeChix, OpenHatch and others - all of whom are dedicated to increasing diversity in IT. That was awesome too.

So what about the technology itself? I learned that Python is a clean, elegant, powerful language based on some well-designed abstractions, with a rich ecosystem of libraries and tools. Python seems to satisfy both the "easy to learn" camp and the high end "power user" which is no mean feat. I was very impressed with how deeply baked iterators, generators and comprehensions are into the both the language and the "social norms" around building software - that sort of consistency (and flexibility) is important and it's one of the things I love about Clojure (the sequence abstraction). Several sessions I attended covered iterators and generators and a couple touched on coroutines (which seem to be implemented as generators that yield to each other, which is pretty slick). The idea of contexts is very powerful, similar in some ways to Clojure's structural macros, so that you can easily run code in, say, the "context" of an open file and have the file automatically closed for you. Another powerful aspect of Python which I liked was how tuples are used for multiple assignments, similar to destructuring in Clojure, and it was good to know that this is both idiomatic, fast and atomic. Another session covered Python's class support and showed how to create the simplest possible code needed yet be able to enhance it over time as requirements changed in ways that would not break early clients of the class: starting with public attributes and switching to implicit property getters and setters with changing how the class was used, using decorators (annotations).

I went to PyCon thinking Python was "just another scripting language" but I came back thinking that "Python is awesome!".

Tags: python

congomongo 0.4.1 released

March 14, 2013 ·

CongoMongo (on Github) has just received a small update today, adding a few more advanced features:

  • read preference supported (per-connection, per-collection, per-fetch) - Niclas Meier
  • add-index! supports :background true/false - dwwoelfel
  • namespaced keyword keys in maps are roundtripped correctly - Adam Clements

See also CongoMongo on clojars.

Tags: clojure · congomongo · mongodb

clj-time 0.4.5 released

March 14, 2013 ·

It had been a while since the last release of clj-time (on Github) (July 2012) so I figured it was about time to have an update, to officially release the features that community members have been adding:

  • Add testing predicates for days (e.g., tuesday?) and months (e.g., july?) - Devin Walters
  • Change base Clojure version from 1.3.0 to 1.4.0 (we're testing against 1.3.0 and 1.5.1 now)
  • format-local-time now returns nil on a bad format string (instead of silently returning the current time!) - mw10013
  • date-midnight is now supported across all the coercions - Nick Barnwell, with a fix from Tom McNulty
  • Correct parse-local behavior when no format is given - Ben Poweski
  • Added MIT-LICENSE.txt - thank you David Powell for the nudge!
  • Add support for Joda's YearMonth - Ragnard DahlĂ©n
  • Add instant->map producing readable Clojure-format date/time, interval and period values - Thiago Nunes

I'd also like to give a special shout out to Michael Klishin for attention to the documentation and for review and input on some of these features!

See also clj-time on clojars.

Tags: clj-time · clojure