Some Lessons From Forth

It’s easy to get caught up in the “newer is better” mindset of software development and forget that ideas are more important than code. Not everything we do is obsolete in four years. The Evolution of Forth, which outlines Charles Moore’s guiding principles in creating and implementing the FORTH language, is an excellent illustration of the timelessness of ancient computer wisdom:

  1. Keep it simple
    As the number of capabilities you add to a program increases, the complexity of the program increases exponentially. The problem of maintaining compatibility among these capabilities, to say nothing of some sort of internal consistency in the program, can easily get out of hand. You can avoid this if you apply the Basic Principle. You may be acquainted with an operating system that ignored the Basic Principle. It is very hard to apply. All the pressures, internal and external, conspire to add features to your program. After all, it only takes a half-dozen instructions, so why not? The only opposing pressure is the Basic Principle, and if you ignore it, there is no opposing pressure.

  2. Do not speculate
    Do not put code in your program that might be used. Do not leave hooks on which you can hang extensions. The things you might want to do are infinite; that means that each has 0 probability of realization. If you need an extension later, you can code it later – and probably do a better job than if you did it now. And if someone else adds the extension, will he notice the hooks you left? Will you document this aspect of your program?

  3. Do it yourself
    The conventional approach, enforced to a greater or lesser extent, is that you shall use a standard subroutine. I say that you should write your own subroutines. Before you can write your own subroutines, you have to know how. This means, to be practical, that you have written it before; which makes it difficult to get started. But give it a try. After writing the same subroutine a dozen times on as many computers and languages, you’ll be pretty good at it.

I covered the first two points before in KISS and YAGNI. Point 3 is more subtle. It seems to fly in the face of don’t repeat yourself, but what he’s really saying – and I agree – is that you have to make your own mistakes to truly learn. There’s a world of difference between someone explaining “you should always index your tables because it’s a best practice,” and having your app get progressively slower as records are added to the table.* You learn “why” a lot faster when you’re actually experiencing it instead of passively reading about it.

Moore characterizes simplicity as a force that must be applied instead of a passive goal. And he’s right – all too often, I see developers failing to make the hard choices necessary to keep their applications simple. It’s easier to just say yes to everything.

*You laugh, but I’ve worked with developers who did this.

Related posts

I Fight For The Users

I Fight For The Users

If you haven’t been able to keep up with my blistering pace of one blog post per year, I don’t blame you. There’s a lot going on right now. It’s a busy time. But let’s pause and take a moment to celebrate that Elon Musk

By Jeff Atwood ·
Comments
Updating The Single Most Influential Book of the BASIC Era

Updating The Single Most Influential Book of the BASIC Era

In a way, these two books are responsible for my entire professional career. With early computers, you didn’t boot up to a fancy schmancy desktop, or a screen full of apps you could easily poke and prod with your finger. No, those computers booted up to the command line.

By Jeff Atwood ·
Comments
To Serve Man, with Software

To Serve Man, with Software

I didn’t choose to be a programmer. Somehow, it seemed, the computers chose me. For a long time, that was fine, that was enough; that was all I needed. But along the way I never felt that being a programmer was this unambiguously great-for-everyone career field with zero downsides.

By Jeff Atwood ·
Comments
The Raspberry Pi Has Revolutionized Emulation

The Raspberry Pi Has Revolutionized Emulation

very geek goes through a phase where they discover emulation. It’s practically a rite of passage. I think I spent most of my childhood – and a large part of my life as a young adult – desperately wishing I was in a video game arcade. When I finally obtained my

By Jeff Atwood ·
Comments

Recent Posts

Let's Talk About The American Dream

Let's Talk About The American Dream

A few months ago I wrote about what it means to stay gold — to hold on to the best parts of ourselves, our communities, and the American Dream itself. But staying gold isn’t passive. It takes work. It takes action. It takes hard conversations that ask us to confront

By Jeff Atwood ·
Comments
Stay Gold, America

Stay Gold, America

We are at an unprecedented point in American history, and I'm concerned we may lose sight of the American Dream.

By Jeff Atwood ·
Comments
The Great Filter Comes For Us All

The Great Filter Comes For Us All

With a 13 billion year head start on evolution, why haven’t any other forms of life in the universe contacted us by now? (Arrival is a fantastic movie. Watch it, but don’t stop there – read the Story of Your Life novella it was based on for so much

By Jeff Atwood ·
Comments
I’m feeling unlucky... 🎲   See All Posts