Borrowing books for a Montgomery County library these days is like checking out groceries in a computerized supermarket.

The library cards have codes similar to the UPC (Universal Product Code) bars on a can of peas. The librarian simply runs a special pen across the card and the computer records the number and shows it on a television-like screen.

With another rub across a label attached to the back of the book, the computer records that book as checked out to the cardholder.

The computer speeds up checkouts, keeps a record of borrowed books, spews out overdue notices and makes it possible, for the first time, for the county to know precisely where any one of its 1.4 million books is.

The Montgomery County Public Library system is one of the most heavily used in the country. With an average circulation of 9.4 books per county resident in 1978, the last year for which figures are available, Montgomery was second only to Baltimore County in the nation. Montgomery limits borrowing to 50 books per borrower at one time, and people complain. "They read like mad in this county," said director Agnes Griffen. "It's wonderful -- they just eat books."

Montgomery now has the biggest computer system among libraries its size -- 82 terminals in use in 19 branches. Prince George's County soon will be following suit, with a $491,000 system that will place about 50 terminals in 20 branches. Library staffers are bar-coding books and registering patrons, and expect to have the first terminals operating in the Oxon Hill branch this summer.

Fairfax County and the District of Columbia library systems have computer terminals in four and five branches, respectively, and expect to have terminals throughout their branches by mid-summer.

On Saturday, the Rockville Library's businest day, a woman juggling two toddlers and eight Dr. Seuss books thought she might have left another book around the house somewhere.

Under the old system, there would be no way to check until overdue notices were tabulated, and these were running five months behind schedule. But with the new system the librarian had only to run the "wand" across the woman's card and a list of all the titles she had borrowed appeared on the screen. Yes, "Horton Hatches the Egg" must have been left at home.

A year ago, the books she checked out would have been among about 3,000 transactions on a roll of film, each book photographed with her card lying next to it. When books were returned to the library, the card from the back of the book was arranged with others in chronological order and someone in a back room had to read the film and note the titles -- and their borrowers -- still outstanding.

The procedure was so tedious and labor-intensive that it was usually five months behind. And, until someone read the film, no one would know who had a particular book if it was not on the shelf -- or even if it had been borrowed, rather than stolen or lost.

Now, John Myers, 62, of Rockville, can find out quickly if any branch has the books on Alaska he wants to read before he and his wife Shirley join a tour there this fall. Estelle Alexander at the information desk in the Rockville Library types onto the keyboard the first three letters of the author's name and the initials of each word in the title. The cursor rolls across the screen, printing out the name of the branch, the number of copies the library system owns and if any are currently on the shelves.

The $946,500 system, installed last summer and now in its final test period, got off to a rocky start, however. There were frequent "crashes," when the computer stopped functioning and librarians had to write down on paper nine of the 14 digits for the borrower and each book. (The first five digits are identical for Montgomery County residents and a particular branch's books.) When the system was restored, these were typed in.

Employe moral plummeted and borrowers complained.

"They called it Finkler's Folly," said Norman Finkler, formed director of the public libraries, who retired last summer. "It was one of my major objectives before I retired," he confided, somewhat mischievously. "I wanted to get it all installed and leave the problems for my successor."

But computerization was inevitable, he said.

"The money available for library services was always at the bottom of any budget," said Finkler. "With other prices rising, there's pressure to do more with fewer people, so it's inevitable. Whether you hate machines or you love them, you've got to make your peace with them."

The new director had the initiation task. Griffen, who came to Montgomery County from the Tuscon public libraries, had overseen the installation of a computer system there, but soon realized Montgomery's would have to be tailored to the locality.

Montgomery's computer, bought from Systems Control Inc., a California-based firm that developed a similar system for libraries in San Jose, needed to be adjusted for the reading needs of this county. The most outstanding difference has been in the recording of the names of readers who want to reserve specific books.

Montgomery residents wanted to read best-sellers and other current titles. Reservation lists ran up to 500 names, a load that caused the computer to slow down.

The library has 80 copies of "Gorky Park" by Martin Cruz Smith, for example, and 387 persons have their names on a list to reserve the book. There are 184 copies of James Michener's "The Covenant" and 152 readers are waiting for it. Toni Morrison's "Tar Baby" hasn't arrived yet, but 262 persons have signed up for it.

"We had told the vendor (Systems Control) about our population had now they read here, but what happened is that people follow Book World (in the Washington Post or The New York Times Book Review, and they want to read the most current books," said Gladys Hedstrom, director of technical services.

"So we have tremendous lists of reserved books. The vendor assumed the reserves would cover a broad span of titles. But Montgomery County has heavy reserves on new titles," she said.

Scanning the reserve list to know a person's place in line, or readjusting the list when names were taken off, slowed the computer's response time on ll functions.

"If a patron is standing there in a hurry to catch a bus, this can be maddening," said Hedstrom.

Adjustments still are being worked out with the company, but in the meantime librarians have been asked not to handle reserves during peak periods.

Hedstrom, who started at the county libraries in 1957 when she had four young children and wanted part-time work, is delighted with the information the computer has made available. She could tell which branches were used most heavily and for what kinds of books, and at what time of day. "Chevy Chase and Little Falls were always known as places of high reserves and the figures bore that out," she said.

She was so tickled with the abundance of data about the libraries' books and borrowers that she spent hours drawing colorful graphs of library usage. "I finally was told to get on to other work," she said with a laugh.

When the system began operation last year, a reader who checked out a book received a silver-colored slip that looked like a grocery receipt but gave the borrower's library card number, the titles and ID numbes of the books and their due dates. But library users complained because books did not bear individual due dates, and they disliked having the extra piece of paper to carry around. Now each book is handstamped with a due date.

"Yeah, at first a lot of pelple complained," said Jim Trusty, a Richard Montgomery High School junior who works in the Rockville Library two hours a day. "They said the silver slips were impersonal. But what do you want? That's progress."