Why Knight won’t be the only one

August 3, 2012, 10:17 PM UTC

FORTUNE — One question keeps arising in the saga of Knight Capital and its $440 million software glitch: why did Knight, one of the premier U.S. market makers that handles more than 10% of total stock trading, introduce glitchy software into the market?

CEO Thomas Joyce explained in a television interview that the company’s new software program sent thousands of erroneous trades into the market because of “a large bug.” This was software Knight introduced Wednesday in conjunction with the New York Stock Exchange’s new platform that allows market makers like Knight (KCG) to offer slightly discounted stock prices to retail investors.

The problem isn’t that Knight is a renegade operator — its reputation has improved over the past 15 years. The problem is that trading software can never be 100% perfect, say computer programmers, especially when it’s new and introduced into a complex system like the stock market. That aspect of electronic trading, which dominates today’s stock market, will certainly cause more crises in the near future.

MORE: Why Knight lost $440 million in 45 minutes

“Because it has so many lines of code and so many variables, the number of different states that software can be in can become [an] enormous number –10 to the 100th power,” says Ed Schlesinger, head of Carnegie Mellon University’s electrical and computer engineering department. Carefully reviewing lines of software code isn’t impossible, he says. Math theorems can do the testing. What is impossible, though, is judging how one firm’s software — Knight’s, for example — will interact with the thousands of other algorithms rushing into and out of the market. That can only occur when the software is in actual use.

Schlesinger chuckles at the notion of perfect trading software. Pundits and politicians have called for more stringent standards of trading programs, essentially advocating for bug-proof code. That, he responds, is impossible. It would be akin to sidelining a wide receiver until he catches every football in every practice against every opposing defensive scheme.

Unfortunately for Knight, what made it so successful over the past 15 years — its growing size — worked against it this week. Unlike other high-frequency traders, who can flip the off-switch the instant they sense trouble, market makers like Knight, which use algorithms to match buyers and sellers from diverse clients such as Scottrade and Vanguard, are required to stay open for business unless there’s a major error. They can trade thousands of shares before waking up to the problem.

“Market makers are required to stay in the market,” says Bernard Donefer, a professor of information systems in financial markets at Baruch College and New York University’s Stern School. Volatility, therefore, affects market makers more than it does the high-frequency-traders whizzing in and out of stocks all day. “If I’m someone else, I can just say, ‘Hmm, let me stop trading for a while,’” says Donefer. “They don’t have nearly the amount of orders that a market maker does.”

MORE: Why this month’s good jobs news won’t last

Instead of pursuing perfect programs, Donefer says, regulators should focus on minimizing the damage when the program’s algorithms go haywire; say, cancel all trades within a 30-minute window. In fact, that sentiment is behind the calls of some to reinstate human market makers on the New York Stock Exchange. Humans move much slower than computers, and are more likely to sniff out irregularities before they metastasize to unmanageable levels. But to revert to the clubby, monopolistic days of human NYSE market makers would be to throw away two decades of improvement. And it’s simply not going to happen. “Right now, you got the lowest spreads, the most liquidity, the fastest trading — it’s a pretty good market for most people,” says Donefer.

Market makers like Knight may occasionally blow up, and trades may have to be cancelled. But that’s the cost of today’s high-speed electronic markets, and, for most people, it’s probably a fair trade off.