DEV Community

Frank Font
Frank Font

Posted on • Edited on

2 1

Wishful Programming

I'm sure I could write that program if I knew how to do that one thing.
And I could do that one thing if I knew how to do that other thing.
Wish I knew how to do that stuff.

Creating Programs With Wishes

There is a practical software development strategy which a Computer Science professor ( many years ago ) described to our class as "wishful programming" and over the years I've successfully applied it, whatever the language.

It is very simple.

Here is the gist of the approach:

  1. Stub out a function ( or method or module ) with just a name and no body content.
  2. For the body, call functions ( or methods etc ) that you wish existed, then stub out those functions and methods too.
  3. Keep doing this until you have a collection of stubs that together, if they did anything real, would complete your program.

The magic is that in the process of doing that you are breaking down the task into smaller pieces. And as you do it, you are shifting the heavy lifting into smaller functions ( or methods ) at the edges.

It really does work.

More recently I've learned the above approach is an example of the "backcasting" technique.

The application of this idea also ties into becoming a more creative person, which I wrote something about here.

If you've worked this way before, let me know. Let's compare notes.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay