One of the perks of being a science fiction writer is that you get to hang out with other science fiction writers. A few weeks ago, I had the privilege of going out to dinner with Larry Niven, Jerry Pournelle and Tim Powers, three of my favorite authors in the Los Angeles area. As usual, the conversation sprawled across an eclectic range of analyses, extrapolations, predictions, insights and occasional bits of gossip about authors no longer with us. And at one point, we even talked about science fiction.

I shared a comment from David Brin that science fiction might better be called “Speculative History,” and this was also one of the ideas we considered. It’s an interesting insight, because many science fiction writers are avid students of history, using historical precedents as a foundation for world-building.

Indeed, get a group of authors together at the dinner table and the conversation will ramble peripatetically from the collapse of the Roman empire (choked to death by an overdose of taxes, Christians and lawyers), to the Third Reich’s belated invention of the stealth fighter-bomber, to why the premature launching of Hobart Percy’s floating tanks and their subsequent sinking offshore resulted in 3,000 American casualties on bloody Omaha beach, to why Eisenhower’s recognition of the military value of Hitler’s autobahns resulted in an American investment in the Interstate Highway System that triggered enormous growth in the U.S. economy, to whether or not the Chinese reached America in 1491, and why Wernher von Braun’s shortsighted advocacy of installing unworkable Jupiter missiles in Turkey helped create the Cuban missile crisis.

There are two points worth noting about American military history. This nation is 236 years old. For most of our history, we have been at war—if not with someone else, then with ourselves. Either we really like war or it’s very profitable. Or it’s just too much fun to stop and we’ll just do it until we need glasses.

But there’s another point to be made. A great deal of America’s technological progress has been the direct result of the enormous investment that this nation has made in military technology, a trend that continues today. In fact, you could argue that almost all of human history has been driven by a never-ending arms race.

Don’t take my word for it. If you have cable or satellite, you probably have access to various channels that focus on military history. Between the Science Channel, the Discovery Channel, the Military Channel, the History Channel and the Smithsonian Channel, you have access to an enormous menu of documentaries about crossbows, armor, fortifications, castles, catapults, trebuchets, spies, Greek fire, codes and code-breaking, submarines, destroyers, aircraft carriers, fighters, bombers, bombsights, incendiaries, napalm, nuclear devices, missiles, drones, satellites, cameras, radar, sonar, beam weapons, railguns, and a whole bunch of things that never made it out of the laboratories.

Those who study war—especially those who study war because they want to prevent the next one—are very much aware of the single most fatal flaw that any nation can make: preparing to fight the previous war. Too often, resources are invested in developing and building superior technology for last year’s battles, and too often that technology is already obsolete before it leaves the factory because the shape of modern warfare is constantly morphing into something else again.

Now what does any of this have to do with software development? I’m glad you asked that question.

Look around. How many software developers—both individuals and companies—are still preparing to fight a war that’s already over? Let’s look to our own history. By the end of the 1980s, the market for MS-DOS applications was mature. Various companies had staked out their specific areas of success and established themselves as the definitive standard. Lotus 1-2-3 owned the spreadsheet market. WordPerfect and WordStar dominated the word processing field. Turbo Pascal was the language of choice for most hobbyists and a lot of professionals.

All of those products were cash cows for the respective publishers. The companies were doing well selling to businesses, students and new computer owners everywhere, on top of the considerable income they made from selling yearly feature upgrades to previous purchasers. It was a good business plan, especially if you owned your market niche, but only if you assumed the existing model of the customer base was going to remain a good model for the future.

Windows 3.0 arrived in 1990 and it was a whole new game. Almost none of those companies were ready for it. But Windows wasn’t a surprise. It was never a secret. Microsoft had been developing it for years—and the widespread adoption of the 386 chip meant that a lot of machines were ready for it.

On the day that Windows 3.0 shipped, Microsoft also had Word and Excel and Visual BASIC ready. Meanwhile, it was a year before Lotus released 1-2-3 for Windows, and even longer before WordPerfect or WordStar released Windows versions. By then, it was too late. The market had already solidified and they were left outside with their noses pressed up against the Windows paradigm. Today, those publishers and their products are forgotten. They are footnotes in computer history because they didn’t prepare for the next war.

So how does that lesson apply today?

Consider, for example, a group of talented and enthusiastic programmers. They have an idea for an app. Should they develop it for the desktop market? That market isn’t dead, but is it cost-effective? What about writing it for a console: X-Box or PlayStation? But can they compete with the big developers?

How about developing their app for the smartphone? Should they aim for the iPhone market? Certainly the iPhone is the most popular of all smartphones, it has an enthusiastic user base… but the iPhone app store already has more than 675,000 apps in it. Their app will be lost in the crowd. They could develop for Android phones, but that market already has more than 600,000 apps as well. How about the Windows phone? Is that market worth the effort? The jury is still out, and might be for a long time to come.

Maybe it’s a mistake to aim for the smartphone market at all. That market is mature. It’s saturated. The best ecological niches have already been filled. This isn’t to say that there aren’t still opportunities, especially if you have a remarkable application that does something that no one else is doing. But first take a step back: Are you still trying to win the last war? Or are you preparing for the next one?

What opportunities are visible on the technological horizon? Right now, Windows 8 is the obvious one. And if the Windows 8 Surface tablet is a hit, it could be a very lucrative market for a long time to come. A Windows 8 tablet app might be a risky investment, but the risk-to-reward ratio could be enough to justify it. There’s no question that Microsoft has a long-range mindset. So should any company swimming in their wake.

But maybe you’re not ready to invest in Windows 8. Okay, what other opportunities should a software developer be considering? What new ecologies are about to happen? What ecological niches have not yet been filled?

Well, who’s buying chips? What are they putting them into? That should tell you what markets are developing. How far ahead can you look?

Smart cars? California just became the third state to legalize self-driving vehicles. If you had a car that could drive itself while providing you with real-time Internet access, what application would you like to have in it? How about one that warns you about traffic obstructions in your immediate area so it can avoid them? How about a real-time shopping app that lets you know where to find items you’re looking for and what’s on sale in the stores you pass? How about a tourist app, telling you about local landmarks as you pass them?

Smart refrigerators? Sounds extreme? Maybe. But how about a barcode scanner that notes what’s in the fridge or what’s on your pantry shelves? Maybe it could read the receipt you bring home from the store? It could monitor your kitchen and print out a shopping list of what items are running low—and then send that shopping list to your smartphone or tablet so you’d have it with you on every store visit.

How about having that app refer to a database of products, including prices in all local stores? Maybe that database could suggest recipes based on what’s already in your fridge or on your shelves? And it could include a calorie count for the final meal. How about a diet program that incorporates all this information and guides you toward your desired weight?

What other markets might be developing in the next few years? Consider that the majority of baby boomers will be retiring over the next 5-10 years. What application might you develop for a growing market of seniors? How about an age-specific domain of social-network applications, including volunteering, political involvement and mentoring? Health monitors will certainly be in demand, such as devices to warn seniors when they need to see a doctor for developing issues. And if you can integrate the above-mentioned diet program with an exercise monitor, including adjustments for various physical ailments and diet restrictions, you can output menus and exercise recommendations. A connected individual could have a daily guideline for maximum health. Could you make it a game where each milestone unlocks an achievement?

How about a whole-house monitoring system? As more and more of our various devices get their own IPv6 addresses, we’ll finally have the ability to create a true smart-home, one that monitors its own carbon footprint and adjusts its usage of gas and electricity accordingly. Include security cameras, smoke detectors, carbon monoxide detectors, flood detectors, and systems to watch out for various kinds of vermin, and you can create a safer house as well.

Obviously, I’m talking about some big projects here, but they don’t have to be constructed all at once. They can be developed a piece at a time. Eventually, software is going to evolve from applications to “agents” (think Siri or Majel). Software agents will talk to each other, and will make choices based on the information they gather and exchange. (Standards will have to be developed. Companies that define standards own them—and make millions of dollars from license fees. There’s another opportunity.)

Software agents may be the ultimate shape of the market—not the individual app, but the app that calls it. There’s another developing ecology.

Ultimately, whatever this industry becomes in the next five or 10 or 20 years, it will be won by those who prepared for it.

What do you think?

David Gerrold is the author of over 50 books, several hundred articles and columns, and over a dozen television episodes, including the famous “Star Trek” episode, “The Trouble with Tribbles.” He is also an authority on computer software and programming, and takes a broad view of the evolution of advanced technologies. Readers may remember Gerrold from the Computer Language Magazine forum on CompuServe, where he was a frequent and prolific contributor in the 1990s.