Ben Zimmer explores the eytomology of "nerd":

The earliest known example comes from an Oct. 8, 1951, Newsweek article rounding up teenager talk from around the country. “In Detroit,” according to the article, “someone who once would be called a drip or a square is now, regrettably, a nerd, or in a less severe case, a scurve.” Over the next few years, the Newsweek slang - nerd included - got rehashed in other magazines, like Reader’s Digest and Collier’s. By 1954, nerd had spread to Denver, according to an Associated Press article. William Morris entered the word in his “Real Gone Lexicon” that same year, defining it as “a square, one who is not up with the times.”

A few weeks ago, my 7 year old daughter told me that a counselor at her day camp was a nerd. I immediately reproached her -- this was a mean thing to say, she should never call anybody a nerd. Confused, she replied that the counselor had used the term to describe herself. A nerd, my daughter explained, meant a person with a deep interest in a particular subject -- a math nerd, a photography nerd, a Harry Potter nerd.

I suspect that the word's negative connotation is an artifact of previous generations' hostility toward technology. It wasn't long ago that possession of even fairly basic technology skills was a mark of shame. Check out this Simpsons episode from 1995, in which Bart is introduced to the nerd table at school. One of the nerds is called "Email," familiarity with which was sufficient to demonstrate a status as a freak (the relevant scene starts at 7:50, but the entire episode is great):


Ham: Won't you join us, Bart?
Bart: [looks around] Uh...I guess so.
Database: As the first student at Springfield Elementary to discover a
comet, we're very proud to make you a member of our very select group.  Welcome to Super Friends.
Bart: Huh?
Kids: Welcome, Super Friend
Ham: I am called Ham, because I enjoy ham radio.  This is Email...Cosine...Report Card...Database...and Lisa.Your nickname will be Cosmos.
Bart: [finishing a mouthful hurriedly] Well, I'm done eating.
Goodbye.


Today, that joke would be moot -- not only the particular gag that only geeks use email but also, I'd argue, the general premise that only geeks understand technology. Mastery of a wide array of gadgets is de rigueur among the younger generation, making it almost impossible for them to imagine that mastery of some other set of devices is uncool. "Nerd" has almost totally lost its stigma. A nerd is simply an enthusiast. One can be almost any kind of nerd -- even a professional football player describing himself as a football nerd, a term that, twenty-five years ago, would have made no sense.

This is, I think, one of the salutary trends in American culture.