Categories
Programming

How to spend time

I’ve got to the start where I’ve abandoned too many personal programming projects. Now I’m loathed to start any new ones unless it’s going to be really signficant.

I can think of three reasons for doing a project – to create something, to learn something, or because you’ve got nothing better to do.

Creating something is the raison d’etre of programming. Creating something new is great. Pushing the envelope, exploring new ground. Finding a more efficient, elegant or more general solution to an already solved problem is great. In contrast, reinventing the wheel is loathsome. Writing Yet Another Window Manager or Yet Another Text Editor should a hangable offence.

Having said that, writing programs for your own education is part of the ongoing process of improvement which any programmer should pursue. Writing a garbage collector yourself is probably the best way to learn about them. But I try hard to limit the scope of “learning programs” because otherwise you can spend weeks on irrelevant details.

The last reason – “because you’ve nothing else to do” – is the worst reason for sitting programming a computer. Directionless wandering will suck hours from your life, and at the end you’re only tired rather than wise.

So, I’ve written substantial, yet incomplete, portions of DTP programs, compiler backends. I’ve written too many raytracers, mostly as a way of learning a new language. They’re complex enough to explore the language and tools adequately, but I know how to write one from memory.

Categories
General

LL2

I’m working my way through the videos from the Lightweight Languages 2002 (LL2) conference at MIT. Yay, for digital videos of conferences! Boo, for doing it in RealVideo format. This isn’t just because I can’t archive it locally, but also because there isn’t terribly much action to watch. Most of the time, the camera focuses on the presenter’s slides, which appear blurry and pixelated after the RealVideo codec has squished them. I look forward to the day when SMIL or some other integrated multimedia solution allows us to mix audio/text/html/pdf/video in a syncronized stream. It would be a great boost for online learning.

Anyhow, I’ve just watched Matthew Flatt’s presentation in which he plays with the distinction between programming languages and operating systems. He makes the point that safe languages (such as ml, where the type system guarantees that you won’t suffer pointer errors) remove at least some of the reasons for having processes occupying seperate address spaces. Unlike in C++, an ML program will never scribble over the end of a heap block. So, if your citizens are well enough behaved, they can all live in the one house together.

Hmm, must leave to get to band practise now …

Categories
General

Hardware, for once

A few years ago, I dabbled in hardware by building a programmer and test circuit using the PIC microcontroller. At the time, I wished that I had a digital camera so that I could put up a webpage. Well, four years have passed and I finally have a digital camera, so here it is.

I think building these circuits exorcised my hardware daemons. I feel no further need to build “little computers” (which was what Susan’s mum would call it). Normal service will be resumed shortly.

Categories
Programming

Stunt Debugging with C++

I’ve used the DevStudio debugger for years. Until today, an “access violation” dialog meant “game over”. You could poke around with the debugger to find out why your application crashed, but since your application was already dead, it was basically just a post-mortem. And then today, I realised that you can often ressurect the program …

Categories
Blogging

Cold Turkey

The blogging world has been a great discovery for me. For the first time, I can tune into the thoughts of people who share the same niche interest as I do. This was never possible to the same degree with usenet or mailing lists. However, I’ve started suffering information overload from this! Reading everyone else’s blogs has just encouraged me to spend more and more time thinking and reading about programminging stuff. Normally, this wouldn’t be a problem. However, I have a full-time programming job too, and as life would conspire, it has nothing to do with compilers or programming languages. I feel that I’ve recently been working two jobs instead of one – burning my brain at both ends, so to speak. Consequently, I’m making a conscious effort to spend less time doing computer-related stuff, in an effort to restore a bit of balance. I’ll be trimming out a lot of the “wasted time” I spend sitting on front of a computer. You know, like when you sit down to do one websearch and *pow* it’s suddenly two hours later? Anyhow, I know the world ain’t going to stop just because I don’t read about compilers for a week ..