As far as programming languages go, my truly favorite language is a
Lisp. Scheme or Common Lisp are fine. I have a few hesitations about
Clojure (the way it does recursion is offputting
to me, but perhaps a few macros might clean it up), but for what I’ve
done with it when working with Riemann, it’s been
a pleasure, even if it’s slow going because I don’t do it frequently
enough to have the needed bits already in my head.
In one of my previous posts, I wrote
about how I’d written the website software for a website I maintain in
Common Lisp. There were a few macros I wrote while building it that I
thought were potentially useful and illustrative of the kinds of
things you can do with macros that make Lisps cool.
In this post (there may be others later), I’ll be talking about a
macro I wrote to deal with database queries. When dealing with
database queries, making sure that you write/generate the queries
properly with respect to escaping and bind variables, and connection
caching, etc. can be a real pain, and I’m not a big fan of ORMs as
they never really do what I want.
In the course of reading various design patterns and refactoring books (like Refactoring), I noticed while flow control is sorta mentioned here and there, it’s not addressed especially well. It mostly encourages things like replacing conditional with polymorphism and replace nested conditional with guard clauses and the like, rather than finding ways to straighten out and clarify code that contains flow control and conditionals.
One of my thoughts on flow control and conditionals follows one of the rules of the Zen of Python:
Given that people can get really touchy on the subject, let me state this up front: I’m not saying we should tolerate lousy code.
Over the course of my career, I’ve seen something that I will call “the cult of abstraction.” On the surface, this sounds like a good thing, until you need to debug their code. While on the surface, it’s all nice and pretty, and uses classic design patterns, when you actually want to find out what it does, you discover that:
(see here for the full Agile Organizer series)
For a long time, I’ve tried a multitude of personal organization systems, from the normal calendars, to online calendars, to Evernote, org-mode, and so on and nothing has ever truly worked for me. The main reason is that I’ve got a few main needs:
Capture - if it never makes it in, it’s gone Ideation - have to be able to brainstorm with it Reference - for things I need frequently enough, but not so much that I keep it in my head Planning - what am I doing?