In an era of crowded classrooms, students in the computer science class at Malden High School had plenty of room to spread out as they whiled away the final hours of the school year tinkering with programming code.

Of the school’s 1,850 students, just 16 took its most advanced computer science course in the academic year just concluded, reflecting a pattern statewide.

“No one understands what we do,” said Ivan Williams, a junior, explaining why more students did not take a course he considers as important as English or social studies. “Our whole world runs on computers. It’s like being illiterate if you don’t know how to work on them.”

Massachusetts is among a handful of states with high schools at the forefront of teaching computer sciences, but what is lagging is student interest. Only a fraction of the state’s students enroll in classes that teach the kinds of skills that technology companies are looking for.

That is starting to change, as word spreads that software engineers are among the highest-paid professionals. But it is not happening fast enough for the tech industry, prompting a coalition of companies including Google Inc. and Microsoft Corp., along with Massachusetts business groups, to recently push the state to ensure that every public school student has access to a computer science class beginning in elementary school.

Last year, 23 of the state’s 378 public high schools taught a programming class in which 10 or more students took an Advanced Placement exam in the subject, according to Mass Insight Education, a nonprofit
promoting advanced learning.

Of the 85,753 AP exams taken by Massachusetts students last year, only 913 were in computing.

But putting even the most basic programming classes in every school would be a massive undertaking and require years to design new statewide computing standards and curriculum, and to train and hire new teachers, admits MassCAN
, the business coalition pushing to expand computer science education.

The group has not said how much it would cost to implement the proposal, but one of its next steps is to begin raising money, said Jim Stanton, senior project manager of the nonprofit Education Development Center Inc., who is heading up the MassCAN effort.

So far it has raised $155,000 from corporate sponsors such as Google and the Massachusetts Technology Collaborative
.

Computer science has not been popular because typically only college-level courses are offered, which can intimidate students. Those classes demand that students have advanced math skills, and basic knowledge of coding and computational logic. These are not classes about how to use computers, but how to make software programs or design video games. And computer science teachers regularly recruit their schools’ brightest math students.

What advocates for greater computing education want are more introductory classes at earlier grades. That way, they say, barriers to entry are lower and more students will start taking the advanced classes.

In June, the National Science Foundation announced a $5.2 million grant to the College Board, the nonprofit that develops Advanced Placement course work, so it can develop a new class to get more students interested in taking computing in high school. The new classes will be introduced in 2016.

Until computer science is offered more broadly, and in a way that is approachable by a greater number of students, the state’s current system “creates pockets of excellence to which some kids have access, and deserts in which no kids have access,” said Chris Stephenson, executive director of the Computer Science Teachers Association, based in New York. “That’s fundamentally unjust.”

Some states such as Texas and Georgia are trying to adapt to this disparity by allowing computer science to count toward graduation.

“We’ve never seen a national awakening to the fact that this is a problem, and these are skills that students have to have,” said Stephenson. “If we don’t fix this within the next couple of years, this is a monumental fail.”

In Massachusetts, some schools specialize in computer science and technology, such as Worcester Technical High School
and TechBoston Academy pilot school, which places city students at internships at local tech companies.

At others such as Winchester High School, teachers and administrators offer not just advanced courses in programming, but classes in robotics and smartphone app design to interest more kids. And more are beginning to show interest.

“Some of it’s video games. Some of it’s that everyone has an iPhone in their pocket. It has to rub off that somebody made this stuff,” said David Petty, a computer science teacher in Winchester. “It’s no longer something only for brainiacs.”

So far, 30 students have enrolled in Petty’s advanced computer science class for next year, a big jump over the 19 that he taught this year. Numbers are growing in Malden, too, where high school computer science teacher Paul Marques will have a record 148 students taking a total of five courses next year.

Those are still low numbers, but word is spreading that technology companies are hungry for talent, and they are willing to pay top dollar, too. “That definitely helps,” said Marques. “Let’s be real. Money talks.”

Wai Cheang will start working at Cisco Systems Inc. this month with a starting salary of $70,000 — about double the state’s average — just weeks after graduating with a computer science degree from the University of Massachusetts Amherst.

An emigrant from China, Cheang took her first computing course in 2006 at Malden High School with Marques, whom she credits with setting her down the path to becoming a computer engineer.

Though Cheang is something of a poster child for more computer science education, she does not think programming should be something that every student in Massachusetts should be required to take.

“Programming shouldn’t be forced on all students,” she said. “Computer science doesn’t relate to everything else.”

Correction: Because of a reporting error, a Page One story Wednesday misstated the name of the Education Development Center Inc. It also incorrectly described the TechBoston Academy. It is a pilot school.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.