Thomas Wheat, hired as a civilian comunications officer by the D.C. $1police department in March, was fired six months later. His offense was saying he could not afford to live in Washington, as required by law, on his $12,500-a-year salary.

"We barely make it out in Falls Church," said Wheat, a former Navy radioman who is now selling television sets at Sears to help support his wife and two sons. "How could we afford to live in the District?"

Wheat and nine other District Columbia employes were the first victims of the city's controversial residency law, an adaptiation of an idea whose time may have passed, according to municipal government experts and the experiences of other governments.

Residency laws have stirred controversy throughout the nation. In some instances, city laws have been invalidated by countermeasures enacted by state legislatures responding to the cries of powerful unions. In other cases, city employes have simply maintained dual residence, often through rented rooms or virtual mail drops at the homes of relatives.

San Francisco's residency law was declared unconstitutional. In Newark, the mayor has given up hope of enforcing a residency requirement In Atlanta, the mayor has abandoned efforts to have one passed. The Prince George's County Council last week rejected a proposed residency law, and no other jurisdiction in the Washington area has a residency requirement, although department heads in Alexandria must live in the city.

THE D.C. City Council passed the residency law in 1977. The measure became effective Jan. 1, and requires all new city employees to be city residents within 6 months of being hired or lose their jobs.

It is similar to ordinances passed by other liberal governments in the last decade, particularly those headed by blacks who came to political power in urban centers with large or growing black populations, troubled tax bases and government work forces with significant numbers of whites or suburbanites.

But the promises of civic pride, more sensitive civil servants, more jobs for blacks and a viable alternative to the loss of revenue from the lack of a commuter tax already are in danger of being nullified.

With the city expected to begin full-scale collective bargaining next year, disgruntled labor unions are threatening to make the law an issue. Shortages of valuable personnel such as doctors, nurses and even computer operators are forcing city officials to make significant exceptions to the still-young rule.

The continually high price of housing in Washington has not only hampered recruiting for new job applicants. It has also driven from the city many of the blacks expected to benefit from the law when it was being framed.

"In most cities, [residency laws] would hurt a white population," said Stephen L. Hayford, an assistant professor of labor relations at Indiana University and a recognied national expert on residency laws. "In D.C., it becomes just the reverse" with serious long-range implications, he said.

"The residency law is rather narrow, parochial and purely political," said D.C. City Council Chairman Arrington Dixon. "There was a perception, at the time the law was passed, of political expediency for having these requirements. But the minority people, the blacks of the city, for whom we are trying to correct the injustices of the past, are most affected."

Mayor Marion Barry has made the residency issue a personal crusade from the time he was a member of the council. Barry argued that requiring city workers to live here created a fluid and economically viable city, especially since the District -- unlike most other major cities -- is forbidden by congressional decree from taking non-residents who work here.

"I am still supportive of residency," Barry said last week."We've not had that great a difference in attracting people. On the other hand, if we had reciprocal income tax, we wouldn't have to have residency. I haven't lost any top people -- GS-15, GS-16 -- because of residency."

Barry contends that in the District, with 6.8 percent unemployment, there are more than enough takers for the available city jobs. He said that when the District recently gave application tests for the city's fire department, 1,400 people applied for 142 projected job openings -- and 75 percent were D.C. residents.

However, while Barry said he is not backing off this support of the residency law, he is wavering already in his implementation.

He has granted exemptions to 100 doctors and registered nurses who work for the Department of Human Services and D.C. General Hospital. Those hundred, according to D.C. Office of Personnel figures, account for 20 percent of all full-time employes hired by the city since Jan. 1.

Barry said the city's shortage of these professionals was indicative of a nationwide shortage. But Clara Fleet, D.C. General's nursing recruiter, said that "before [the exemptions], people weren't accepting jobs here because the cost of living was too high in the District."

Barry also said he will propose emergency legislation that would exempt badly needed computer specialists and those employes being rehired after losing their jobs in the recent wave of layoffs. All of the 38,000 city employees who were on the city's payrolls before Jan. 1, 1980 are already exempted. City records show that about 50 percent of the city employes now live outside Washington.

Mayors in several other cities who, have tried to enforce residency requirements have encountered stiff opposition from strong municipal employes unions -- especially police, firefighters and teachers' unions -- from the courts, and from their state and local legislatures.

In Atlanta, Mayor Maynard Jackson tried, failed and then eventually gave up. "He got tired of beating his head against the wall," said his press secretrary.

Newark Mayor Kenneth Gibson has tried repeatedly since 1972 to enforce that city's 48-year-old residency law. Conceeded Gibson's press aide: "It [the law] has been largely ignored."

And in San Francisco, a city much like the District in its population size and high cost-of-living, Mayor Diane Feinstein stauchly enforced the city's three-year-old residency law -- until the state's supreme court recently ruled it unconstitutional.

The California court ruled that the San Francisco residency law violated the 14th Amendment in that it limited free travel in other states, such as Pennsylvania, however, similar residency laws have been upheld by the courts, leaving the issue still unsettled.

While Barry so far has not met the kind of stiff opposition to residency that has thwarted the efforts of mayors in other cities, some of the 13 members of the council have been voicing reservations about residency in general.

Unions representing the District's police and firefighters are already vehement in their anti-residency rhetoric, following the examples of their counterparts in other cities. In Detroit, for example, the powerful Detroit Police Officers Association has taken Mayor Coleman Young to court repeatedly. and has successfully used the residency issue in this year's contract talks, causing a stalemate in negotiations.

D.C. teachers, said Harold Fisher, executive assistant to the president of the Washington Teacher's Union, will "definitely" oppose residency in their contract talks with the city, although their executive committee has not yet taken a formal position.

"We're gathering data on housing now and we're going to lobby the council to lift the restrictions," said Larry Melton, vice president of the International Brotherhood of Police Officers. Some 81 percent of the department's 3660 members live outside the city.

"How in the world can the mayor pass a proposal when he had to get a special mortgage rate to buy himself a house in the District?" Melton said. "When you force a police officer to live in the city where housing is at a premium, you're forcing him into low-income housing areas. Those areas are rough. Who wants to be looking over his shoulder for trouble at work all day and then have to go home to the same type of trouble?"

In the fire department, 83 percent of its 1,300 members live outside Washington and tensions are running equally high.

"For these new guys who are making $16,000 a year, buying a house in the District is out of the question," said Kenneth Cox, 2nd vice president of Local 36 of the International Association of Firefighters.

"They want good homes for their wives and good schools for their children, but banks will not lend them the money to buy the $80,000-and-up houses that are being sold in the District . . . and landlords don't want to rent apartments to them because they are afraid, with city finances the way they are, that they could be laid off at any time."

Only 528 full-time employees have entered the city's work force this year. Of those, only 10 have left because of the residency requirement. However, seven firefighters will have to move into the city by Dec. 9 to avoid losing their jobs and 24 others hired earlier this year could face similar dilemmas later.

Politicians, both in Washington and around the country, said the residency law invites a host of other problems.

"As long as we have a serious housing shortage and such a high cost of living in the city," said City Council member Hilda Mason (Statehood-at-Large), "I still have some problems with the law as it stands. (I am for hiring people who live in the city, but an effort has to be made to provide affordable housing for these people. Government has the responsibility to make sure they have places to live."

Others have suggested relaxing the residency requirements for lower-graded city workers. "Why not have an income-cutoff, after which the residency rule wouldn't apply?" said Bogart Leashore, an urban studies and sociology professor at Howard University.

Meanwhile, Thomas Wheat, one of the 10 former city employes who chose to lose his job rather than move, is still looking for a new full-time job. He would have liked to work for the city, but he said, "I had no choice . . . It was ridiculous, on ($12,500-a-year) to even try to live somewhere in the District my wife and kids could be safe."

His modest, two-bedroom apartment in Falls Church costs him $345 a month. In the District, he says, it would have cost him at least $600 to live in Northwest Washington, "the only place I would have wanted to live with the schools and crime rate the way they are.

"I think you should be able to live wherever you want to," said Wheat. "That's what the constitution says, isn't it?"