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.

Read more

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

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

By Jeff Atwood · · Comments

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

By Jeff Atwood · · Comments

The 2030 Self-Driving Car Bet

It's my honor to announce that John Carmack and I have initiated a friendly bet of $10,000* to the 501(c)(3) charity of the winner’s choice: By January 1st, 2030, completely autonomous self-driving cars meeting SAE J3016 level 5 will be commercially available for passenger

By Jeff Atwood · · Comments