WASHINGTON (AP) _ As cable television matures, it is gaining Wall Street accolades for trying to reshape the TV landscape with programming ranging from science for kids to comedy for adults and home shopping for anyone with a credit card.

''Two or three years ago, you could say I don't need cable because I get all the movies and sports I want from the over-the-air networks,'' said Mark Riely, an analyst with the New York brokerage firm Eberstadt Fleming.

''But now some of that sports is migrating to cable, and beyond that you have things that weren't around before,'' such as the Discovery Channel's science and nature programs, home shopping channels and all-news shows, he said.

The $10 billion cable industry is moving out of a construction phase - about 80 percent of the country is wired for cable and nearly half of America's 87 million households subscribe - into an adolescence where programming and marketing hold the key to continued success, analysts say.

Cable companies, many of which are out of the red for the first time and with deregulation last January are able to repackage their services and fees, are reaching deep into their pockets to acquire original and exclusive programming. Their efforts, though, still fall far short of the networks' investment in programmming.

Programming will be one of many issues that will be discussed at the National Cable Television Association's annual convention in Las Vegas, which begins Sunday.

Cable industry figures show that while the time Americans spend watching TV is down slightly from last year, they are watching more on the cable networks at the expense of network affiliates.

In one programming effort, four of the largest cable television companies last year breathed new life into The Discovery Channel, investing $30 million in the Landover, Md.-based channel that is devoted exclusively to entertaining programs about nature, science, technology and world cultures. Launched in 1985, the channel now reaches more than 15 million homes.

Showtime, the second-largest pay-cable network, says one of its most successful programs is the critically acclaimed ''It's Garry Shandling's Show,'' a half-hour comedy produced exclusively for the network. Showtime declined to disclose the cost of the show, produced by the Los Angeles-based Our Production Co.

ESPN, the Entertainment and Sports Programming Network that reaches about 40 million homes, scored a programming coup when it bought a $153 million package of NFL football games - 13 games in each of the next three seasons.

''There was a time when ESPN had Australian football, water polo and obscure sports because they couldn't support the programming,'' said Robert Alter, president of the Cable Television Advertising Bureau.

''Now they have a package of NFL football games and they are carrying NCAA sports, NHL hockey, major golf and tennis tournaments and they carried the America's Cup race,'' he said.

So far, cable's strategy to improve the quality of its programming and to distingish itself from the major networks appears to be succeeding, Alter said.

In the first quarter of this year, the average cable household watched about 58 hours of TV per week, down from about 59 hours in the first quarter of last year.

They watched about 33 1/2 hours of the network affiliates, down about 7 percent from the 1986 first quarter, and about 10 1/2 hours of the basic cable channels, up about 19 percent. Pay channels, the superstations and local independent stations accounted for the rest of the time.

''We seem to be carving it out of the network affiliates,'' Alter said.

''In order to succeed, cable has to make more of the TV medium than conventional broadcasting has,'' said James P. Mooney, president of the National Cable Television Association.

Over-the-air television ''is really mass market advertising,'' said Mooney, because it depends exclusively on ad revenues to make a profit. But cable derives most of its revenues from subscriber fees.

''Conventional broadcast because of its economics has been forced to be a lowest common denominator medium. Cable doesn't have to be shackled to that kind of strategy,'' he said.

Wall Street has greeted cable's forays into programming with a high level of confidence. Cable stocks are expected to outperform the stock market this year as long as interest rates don't rise sharply, Riely said.

West Whittaker, an analyst for Paul Kagan Associates, a Carmel, Calif., media research and investment firm, said cable stocks are looking better than ever because cash flow is stable and subscribership is growing.

''Institutions and investors are recognizing the inherent value of cable,'' he said.

The last two years has been a stormy period for the industry, marked by mergers and consolidation that has sent the value of cable properties soaring.

About 6,500 cable systems serve 40 million subscribers nationwide, according to a recent study by market researcher Frost & Sullivan Inc.

''The revival of cable's fortunes is partly tied to the last major new builds in America that are getting underway,'' according to Frost & Sullivan. Among those planned or under way are cable systems in New York City's outer boroughs, Chicago, Baltimore, Philadelphia and Washington.