TO A YOUNGSTER growing up in the '40s in a farm town in the Nebraska corn country, nothing loomed larger at summer's end than the county fair. In one week, it wrapped up a bonanza of childhood delights: cotton candy and clowns, picnics and parades and the scary thrills of the "Octopus" and "Tilt-a-Whirl" on the carnival midway.

Nowadays, the attractions of a big eastern city can give the county fair stiff competition. But on the outskirts of Washington -- and within a few hours' drive beyond -- these annual harvest festivals are thriving, if for no other reason than they have continued over the years to be bastions of old-fashioned, home-grown fun. Last year, the Montgomery County Fair drew 365,000.

What amazed young and old years ago can still awe and pleasure today's perhaps more sophisticated fair-goer.

Who, for example, can forget stepping into the hog barn and catching sight of an enormous blue-ribbon sow plopped on her side in a nest of straw, her pink underbelly displaying a prodigious array of teats? It was worth a visit every year.

To survive, county fairs have had to modernize (backpacking and rocketry contests at the Prince George's County fair earlier this month), and they continue to provide an educational and commercial service to the community. But they essentially remain unchanged, a throwback to an age when agriculture was king in America -- living museums of the country's past. And that is their enduring appeal.

Get a whiff of the livestock and poultry barns, where the champions await inspection, and remember those days when few people lived very far from a farm. Plunge into the raucous noise and colored lights of the carnival midway, where in more innocent times the seedy shows and games seemed delightfully wicked.

Gaze at gigantic cucumbers and tomatoes that rival melons in size, and wonder what went wrong in your garden. Stroll inside the Home Arts Building, the aromatic world of pickles, pies and preserves. Last fall, Montgomery's home arts competition attracted 4,000 entries from 1,826 county residents. How do you sign up to be a pie-tasting judge?

This year's fair season already is in full swing and will continue into early October. Get out the car, load up the family and plan to spend the entire day. What awaits the traveler is an adventure in Americana.

Down in St. Mary's County, the folks are promising a traditional greased pole contest on Sept. 24. The next day, the 4-H'ers and Future Farmers will put their livestock products up for auction. Sometimes the tears flow when an animal raised from birth heads for the butcher's shop.

If it's a happier ending you are looking for, Montgomery County's 4-H'ers are scrubbing and clipping their pets for the "pretty sheep," "pretty cow" and "pretty goat" competitions. Prizes go to the most original, funniest and prettiest costumes. Sheep, this Tuesday at 7 p.m.; cows, Wednesday at noon; goats, Wednesday at 5 p.m.

This year's "Collossal International Worm Race" for slimys, fuzzies and centipedes already has been run at the just-ended Howard County Fair, but more traditional harness or horse racing is featured at the Maryland (Aug. 28-Sept. 6) and West Virginia (now through Aug. 28) state fairs, the York InterState Fair (Sept. 10-18) and the Great Frederick Fair (Sept. 21-25).

A race of a different sort, "The Sheep-to-Shawl Contest," gets under way tomorrow at 10 a.m. at the Montgomery fair's Home Arts Building. Three teams starting from either the unsheared sheep or the fleece (their choice) will card and spin the wool and weave it into a shawl with decorative fringes. It should take the winner from two to three hours.

What else? Willie Nelson Sept. 11 and 14 at the York Inter-State Fair; high-diving aqua mules and a week-long polka contest at the Great Allentown Fair; nightly fire-works at the Virginia and West Virginia state fairs; and not the least of a day's outing, the food -- a rich mingling of ethnic and homemade at its best and junk at its tempting worst.

To today's carnival-goer, who has tasted the thrill of a loop-to-loop roller coaster, Ferris wheels are out.

That's the word of Jerry Church of Amusements of America of West Caldwell, N.J., whose firm is supplying the carnival rides at some 40 fairs from New York to Florida this fall, including next month's Great Frederick Fair.

What's in? "Speed rides." The dizzying whirls and plunges of the Himalayan and the Swiss Bobsled.

The company has three complete carnivals on the road, a large one with about 70 rides (hauled by a fleet of 75 tractor-trailers) scheduled for Frederick and two smaller ones with about 40 each. "We start in New York in July and end up in the south by the middle of November -- when the crops are picked."

For nostalgic old-timers, the carnival still raises a Ferris wheel on the midway. "We have one, but it's not very popular."

An estimated 150 million tickets are sold annually to America's almost 3,000 county, regional and state fairs. At the Maryland State Fair last year, the crowds numbered 400,000; in richmond, more than a half-million showed up. The totals attest to the continuing popularity of these ages-old fall festivals. But they have had to change over the years to keep their drawing power.

"They're showcases of the community," displaying what the region produces, explains Lewis Miller, executive vice president of the International Association of Fairs and Expositions. As counties moved from a predominantly agricultural base to manufacturing, their "fairs have updated" to keep pace. From cows to cars to home computers.

So much so, it seems, that in some urban areas, says Miller, fair managers have eliminated the traditional livestock judging competition. Instead, amazingly, "they have had to hire herds of dairy cows" -- even in the Midwest -- to maintain a rural flavor for old times' sake. "These days, there's no grandfather's farm to go to. A fair is the only opportunity for an urban kid to see how milk comes out of a cow."

Back in the early '70s, the household arts -- canning, baking, needle-point -- appeared to be on their way out, too. But in the past couple of years, says Miller, "they've come roaring back" as financially pressed families, urban and rural, started planting gardens again, canning the produce and often making their own clothing to beat inflation. "It's been a shot in the arm to the exhibits."

The latest trend at an increasing like theme parks across the country that tend to operate on a pay-one-price basis.

Fairs are at least as old as the Bible when merchants and buyers gathered to deal in crops and crafts, (Ezekiel XXVII: 14-17). A part of the early American scene carried here from Europe, fairs began to evolve into their present form with the emergence in the 1830s of state societies as sponsoring agencies. Virginia's first state fair was held in 1846, and this year from Sept. 23 to Oct. 3 it celebrates its 136th birthday.

In the early years, Fair Week in Virginia "ranked with Christmas and the Fourth of July on the rural holiday calendar," according to a brief history provided by this year's fair. From the beginning, organizers realized entertainment was the key to lure the customers, and that paid for the fair's more serious objectives.

Livestock and crop competitions encouraged the improvement of breed stock and seed. And these large gatherings of farmers were also the ideal place for manufacturers to introduce new and improved machines and methods to plant and harvest the crops. This role as an outdoor classroom continues today:

"The fairs afford us a golden opportunity to meet with farmers and gauge what their problems are," says Dick Wootton, director of the Montgomery County Cooperative Extension Service, whose staff is at the county fairgrounds in Gaithersburg each year offering farm advice. This year, his office is presenting an educational display on a new problem for farmers here -- the gypsy "have been very big on the fair circuit."

"Fairs have proven a tremendous testing ground for many products and services..." agrees Jeanne Baker, exhibits director at the Texas State Fair in Dallas, one of the country's largest expositions. "People have a natural curiosity about who is building a better mousetrap."

In this day of the air-conditioned tractor, the Horse Pulling Contest at the Montgomery County Fair is something of an anachronism. But, says Jimmy Jacobs, the farm-bred man who supervises the event, it still attracts enthusiastic fans.

"People enjoy seeing the animals pull," says the 30-year-old Jacobs, who helps run the family's farm supply company in Gaithersburg. "They're like well-tuned athletes. It gets very competitive." (This year's contest is Tuesday at 7 p.m. at the fairground ballpark.)

The rules are fairly simple. A pair of horses (or mules), guided by one driver, must pull a prescribed weight 27 1/2 feet without stopping. The team gets three trys to haul the sled that distance. Additional weights are added in subsequent elimination trials until the strongest team triumphs. The winning load is usually between 1,600 and 2,000 pounds.

These are big animals, draft horses, often weighing 1,500 pounds or more. They are much larger than the Morgan horses still used on some farms, says Jacobs, and that presents a problem.Fewer people are raising them. "They are an expensive animal to have."

To Jacobs, who grew up exhibiting 4-H livestock at the Montgomery fair, the horse pulling contest is part of "the basic heritage of the county fair." If it disappeared, "it wouldn't be a fair." Does he see that happening anytime soon? "Not if I've got anything to do with it."

Roy Clark. Boxcar Willie. Sylvia. Mel Tillis. Hot names in country music and hot tickets on the fall fair circuit. They are the headliners at the Great Frederick Fair, which last year drew paid attendance of 156,000.

"Country and western is a natural for county fairs. It fits the rural audience like a glove," says Nick Dorr, vice president of Variety Attractions Inc. of Zanesville, Ohio, which provides the entertainment and produces grandstand shows at 400 fairs mostly in the Midwest and East, including the Frederick lineup.

In the big-money entertainment world, fairs hold their own as big business. Even the stars, Willie Nelson, Johnny Cash, Barbara Mandrell, Charlie Pride -- all on Dorr's roster -- "love it," he says. They can gross $75,000 to $100,000 per fair and play in 15 to 25 communities a season, filling a 5,000-seat grandstand twice a night. Besides the money, it means "maximum exposure for their new records and albums."

Variety also supplies the daredevil specialty acts, demolition derbies and auto-thrill shows, one of a number of such firms nationwide. It has about 150 acts under contract.

Who were the top draws on his roster last year? All country-western: Willie Nelson, of course; Alabama, the Statler Brothers, Barbara Mandrell and the Oak Ridge Boys. But for the middle-of-the-road pop audience, says Dorr, it's The Lettermen who have been "a consistent group over the years."

To America's 5 million 4-H'ers (Heart-Head-Health-Hands), county fair is show-and-tell time.

Over the years, 4-H and the county fair have become intricately linked. Annually, these 9- to 19-year-olders nervously put up for display -- and judgment by their peers and elders -- the carefully groomed calves or pigs they have raised from birth or the delicately crafted gown designed for a graduation prom or a wedding. To the local winners goes a chance at national competition in Chicago and perhaps one of 270 $1,000 scholarships.

Among the organization's 30 million alumni: Senate Majority Leader Howard Baker of Tennessee and Sen. Larry Pressler (R-S.D.).

"The fair is the cumulation of a year's activity," says Larry Krug, spokesman for the 4-H National Council in Bethesda. The aim is twofold: to teach specific skills, including such nonagricultural talents as electrical repair and photography, and to aid in personal development through leadership and public-speaking training.

Contrary to popular belief, most 4-H'ers do not live on farms; only about 20 percent do. Another 40 percent live in towns of under 10,000, but 24 percent live in cities of over 50,000. Recently, the organization has seen "a very large enrollment" in horse projects, says Krug, mostly in "affluent suburbia."

If the day before the fair opens is cool, then the Home Arts Building at the Montgomery County Fair is swamped with dessert entries, says Bette Witt, who supervises the household arts competitions. If the day is hot and sticky, the county's cooks and bakers tend to keep their stoves turned off.

Witt, 43, grew up on a farm in Montgomery County and now runs Hines Hatchery in Olney. She's been a regular at the fair since she was 9, succeeding her mother as the volunteer head of the home arts division. Entries last year, she says, were up 25 percent above the previous year. Dried foods is a new category this year.

Cherry and apple pies are the most frequent entries in the pie contest, judged on taste, texture and appearance. If cookies are your specialty, you must enter six that are uniform in size and color. After the ribbons have been awarded, half of each entry is wrapped for the 4-H bake sale the next day.

As for the pie-tasting judges? Witt picks home economics experts from outside Montgomery County -- "so they won't have to judge their neighbors."