Wednesday, January 26, 2011

Testing in Python with a bit of Django

Gave a presentation last night (January 25, 2011) to the Charlotte Django and Python group. Base don the feedback I got from the last presentation I tried to change things up. Mainly by using only 4 slides (including title slide) and lots of code. Which I basically just went though writing a test on a django model.

Slides: https://docs.google.com/present/edit?id=0Af1-cNaYamXFZGczdjlqNDdfMTk4ZGN3dmZod24&hl=en
Code: https://bitbucket.org/lateefj/py_testing/overview (still have to fix views.py)

The best part was the discussion (as always). I would love to do a full day on this which would include setting up buildbot and selenium.

Monday, January 24, 2011

Erlang First Impressions

I attended an Erlang training Saturday January 22, 2011 taught by Kevin Smith (twitter) of much Erlang fame. I first met him last year when he did an Riak presentation to the Charlotte Ruby group. Anyway he is an excellent instructor (maybe a couple to many emacs plugs ;) and it was an amazing class. It was so good I feel like my brain is a little hung over from the experience (or maybe the beer we had after). In an effort to try to medicate I figured I would write up my thoughts.

The good:

  • Concurrency #1 implementation detail
  • Runtime reload of code
  • Shell
  • Atoms
  • Pattern matching parameter over loading / conditional methods
  • Message passing as core part of language is easy and wonderful
  • Monitor / Subervisor to restart services that fail
The bad:
  • Strings (this is pretty bad since it is the most used datatype)
  • Contextual termination ",", ";", "." can all terminate a line / function (I almost like it but don't)
  • Syntax is 30 years old and has not aged well
  • Immutable types
Erlang make concurrency very easy in some ways by making a lot of other programming very difficult. Writing simple service oriented things like key/values stores or simple, reliable CRUD task it is perfect for. Where as for algorithms, string processing and other complex operations it is a poor solution for. Unfortunately I don't have many concurrent distributed problems where the difficult part is getting the concurrency right. However I now understand why databases like CouchDB and Riak are written in erlang. At the moment I am not writing a lot of simple services however I can see how it would be helpful in the future for simple services.