Mr. Yang, 42, the son of Chinese immigrants, grew up in the San Francisco Bay Area. He began drawing at 2, he said, and “I basically never stopped.” His gateway for comic books was Superman, which he began reading in fifth grade. Marvel’s Fantastic Four and Spider-Man soon followed. He started creating his own comics. “I was always interested in telling stories through drawings,” he recalled.

At the University of California, Berkeley, Mr. Yang majored in computer science partly to please his father, who wanted him to pursue something practical, and minored in creative writing. He worked as a computer engineer for two years after graduating and then began teaching computer science at a high school, a job that lasted 17 years. He gave it up only when his travels in support of his books began to involve too much time away.

“Secret Coders,” released in September, was inspired partly by his teaching experience. “What I wanted to do was combine a narrative with lessons,” he said. “You ought to be able to do basic programming from reading the first volume.” Mr. Yang is also running an art contest related to the book to encourage readers to try some basic programming.

Mr. Yang also taps his background for his work with DC Comics. “When DC approached me, ‘Superman as the prototypical immigrant’ was one of my first thoughts,” he wrote in an email. He noted that dual identities are a daily reality for the children of immigrants. “Many of us use one name at home, another at school,” he said. “We move between two different sets of expectations the way many superheroes do.” When he recounted Superman’s origin story in an issue published in November as part of an adventure set in Oakland, Calif., he gave the superhero some immigrant anxieties about belonging.

In reflecting on his new role as ambassador, Mr. Yang said he found his wife, Theresa, a development director for an elementary school, a tremendous resource. He said that he was inspired by her program for encouraging students to read and write in different genres and that she was enthusiastic about the ambassadorship. His children — a son and three daughters — are a little harder to satisfy.

“It is difficult to impress any kid that you see on a daily basis,” Mr. Yang said. The same is true of his children’s reactions to his books, though all of them are avid readers. “They tell me they like them, but they like other people’s books better than mine.”