Category Archives: Programming languages


In a project we’re working on, a Java source file is auto-generated: method names on the interface that is generated (ready for implementing) are based on the HTTP method and URL in the RAML.

The result is this:


What we have here is a single identifier that, at 83 characters in length, is too wide to fit in standard 80-character-wide terminal.

File under “Why Java Is Not My Favourite Programming Language”.

(No, there is no reason why a similar identifier could not in principle be generated in some other programming language. But no other language has the programming culture that make such things possible.)

Scottkit is born! Only seven and a half years late!

Those of you who have been reading this blog since 2nd March 2010 — just three days after the blog was born — might remember the fourth post I ever made here: Learning a language vs. learning a culture, on my switching from Perl to Ruby. Way back then, I wrote about “ScottKit — my first non-trivial Ruby program”. Here it is!

Continue reading

React error-message of the day

This just in:

Failed context type: Invalid context `paneset` of type `Paneset` supplied to `Paneset`, expected instance of `Paneset`.

Oh, the joys of front-end development!

(My best guess: I have two slightly different version of stripes-components library that provides the <Paneset> component in my application, and somehow I’ve got hold of one from the wrong instance.)

Dependency injection demystified

At the moment, most of my actual coding work is in Java — which is a novelty for me, as it’s not a language that I am naturally inclined to like. But as I’m coming to grips with it, I’m finding that Java in 2015 is a rather more pleasant language than the one I wrote a CQL parser in back in 2002. The main problem with it is the culture, and in particular the huge vocabulary of patterns, which takes a long time to learn.


So here is today’s brief lesson, which is on dependency injection. Continue reading


C++: the good parts


JavaScript hashes that inherit from a parent

For a JavaScript program I’m working on, I want to have hashes that can inherit values from a parent. Specifically, I have many widgets, each with a (usually small) hash of configuration parameters; when I access such a parameter and it’s not defined in the widget I want to get the value from the configuration of the team that the widget belongs to; and when that’s not defined I want it to get the value from the global configuration.


Continue reading

Tagore Smith on functional programming

My travails with functional programming have been a bit of a recurring theme on this blog, and I have to admit that my attempt to learn Scheme has stalled, more than anything due to all the other things I’ve been doing.  I’m sufficiently aware of it to feel guilty, but not sufficiently to actually invest the time I ought to into actually learning it.

But today, Togore Smith wrote a brilliantly insightful comment on one of my oldest posts (Closures, finally explained!), and it’s got me thinking about this subject all over again.

Continue reading

We can’t afford to write safe software

Let’s start by thinking about a very simple example.  I’ve recently switched to using Ruby as my language of choice, after a decade as a Perl hacker.  Ruby does a lot of things more nicely than Perl, including having proper object syntax, simple everything-is-an-object semantics, a sweet module/mixin scheme and very easy-to-use closures, so I’ve mostly been very happy with the switch.  In so far as Ruby is a better Perl, I don’t see myself ever writing a new program in Perl again, except where commercial considerations demand it.

Continue reading

A hard-to-find bug, and equivalent APIs in low- and high-level languages

I just wrote an entry about a hard-to-find bug on the blog of my employer, Index Data.  It turned out to hinge on the different API expectations of programmers in low- and high-level languages — specifically C and Ruby — and I think it’ll be of interest to most Reinvigorated Programmer readers.  Enjoy!

The long-overdue serious attempt at Lisp, part 2: is Lisp just too hard?

First, thanks to all of you who advised me on what Lisp to learn.  I found it really helpful to get so many different perspectives, and I hope those of you who advocated Common Lisp or Clojure will not be offended that in the end I chose Scheme.  (Actually, I bet you won’t be: one of the pleasant aspects of the comments on that article was the consistent sense that all the comments were of the form “I prefer this Lisp, but if you learn any of them that’ll be great.”)

A few people suggested that I should learn all the different Lisps rather than just picking one.  As a looong-term project, I guess I agree with that; but here and now, I need to pick one and run with it: and Scheme it is, for its minimality, elegance and purity.  I figured that if I learn Scheme it’ll be easier to move from that to Common Lisp later rather than vice versa.  (I was tempted by Clojure, too, not least because there is only one of it, but it feels just a bit too new-fangled to be a good starting point.)

So two days ago I started working my way through R. Kent Dybvig’s highly regarded book The Scheme Programming Language [,].

Continue reading