Archive for June, 2004

Be concise!

Friday, June 11th, 2004

I recall in an interview a few years ago that I mentioned that I try to write as little code as possible. That raised some eyebrows (but I got the job). It’s not that I don’t enjoy programming - I do, it is my work and my hobby. But it is not the writing of the code that I get a kick out of, it is solving the problem. Typing out the solution in a programming language is, IMO, just a way of documenting the solution, a notation. So the more compact the language the better.

This is why after programming in Arthur Whitney’s languages (k,ksql and q) for > 3 years I find I am frequently reminded how effective they are when I am diverted to do some java or c#. Q is a very concise language. It is not as terse as k, and every now and again that bugs me. But it is an improved k with a different syntax. There are more types, they map better (1 to 1) with types in java and c#, and the operators are more powerful. Arthur (& co.) has obviously applied the many years of experience he has with a huge amount of discipline to actually produce such a piece of software to production quality. And when you consider that the install program is ~120kB, you have to wonder where everyone else is going wrong. It is amusing that this ‘tiny’ piece of code is so powerful.

Excerpt from Introduction to the Theory of Computation, Michael Sipser -

‘Be concise. Brevity helps you express high-level ideas without getting lost in details. Good (mathematical) notation is useful for expressing ideas concisely.‘