A prominent retired federal judge is adding to the chorus of criticism of U.S. Attorney Carmen Ortiz following the suicide of Aaron Swartz last Friday.

Ortiz's prosecution of the acclaimed Internet activist for hacking has drawn harsh comment from newspaper editorials, online users and a petition to the White House with 35,000 signatures.

For 17 years, Nancy Gertner sat as a federal judge here in Boston. She says she was troubled by much of what she learned and saw from the bench before leaving in 2011. And she says Ortiz should not have prosecuted Swartz.

"Just because you can charge someone with a crime, just because a technical crime has been committed, doesn't mean you should," Gertner said.

"At the time of the indictment, [Ortiz] said, 'Stealing is stealing.' I saw that all the time when I was on the bench," she said. "This is a classic line. Stealing an apple if you're hungry is different than Bernie Madoff. It is obviously different."

Swartz allegedly logged onto the computer network at MIT as a guest, using an alias and downloaded four million journal articles from a website JSTOR. For that and various other alleged acts, like hacking into a protected computer, Swartz faced up to $1 million in fines and 35 years in prison.

"Thirty-five years is the maximum someone could get in the case if the judge applied the maximum," Gertner explained. "And this never happens."

Yet under the guidelines, Swartz was facing substantial time. His lawyer says the prosecution stated it would seek a seven- to eight-year sentence if Swartz was convicted.

"And in the world of punishment, the prosecutor has enormous power and he has the enormous power to make you plead guilty and give up your rights," Gertner said.

This is where the judgment of prosecutors, and specifically the judgment of Ortiz, becomes a major issue, Gertner says. She learned on the bench that the power of prosecutors have increased because federal sentencing guidelines have decreased the powers of judges to exercise discretion.

"So the prosecutor determines the charges and the punishment," Gertner explained. "Again, once they start the process, once the indictment is brought, the potential for enormous punishment is there and although a judge has some discretion in sentencing, often what the prosecutor wants is what the person gets.

"When that happens the prosecutor has enormous power and has to exercise that with some degree of fairness and judgment at that end," she added.

And this is what Gertner says Ortiz lacked in the case of Aaron Swartz. If the government was willing to recommend four months in prison, Gertner asks, why not two years in a diversion program which would have suspended and dropped charges if he committed no crimes during that period?

"We don't wreck your life with a criminal prosecution if we think this kind of attention drawn to what you did is all we need to do," Gertner said.

Unlike judges, a U.S. attorney's decisions to charge or not charge are not public and can't be reviewed, except when cases fall apart, like Swartz's. And Gertner has a critical take on the prosecutor The Boston Globe named "Bostonian of the Year" in 2011.

"If the U.S. attorney is going to take credit for every successful prosecution, not matter what the issues were, the U.S. attorney then winds up as 'Bostonian of the Year' for these prosecutions, then you know high-profile prosecutions are valued in the office," Gertner said. "Mr. Swartz was a high-profile prosecution. Whether they are right is another question."

Ortiz has not commented on the case since Swartz's death, stating she wanted to show respect for his family. But on an unverified Twitter account with her husband's name, picture and identification as an IBM executive, someone was tweeting in defense of Ortiz on Tuesday, and criticizing the family of Swartz for blaming her. One tweet read:

Truly incredible that in their own son's obit they blame others for his death and make no mention of the 6-month offer.

The account has since been deleted.

Gertner says this case and the suicide of a troubled young man merits attention to the rest of Ortiz's record.

"What happens with the press, you don't talk about the cases which really reflect this kind of poor judgment. You talk only about the cases that succeed," Gertner said. "This is the example of bad judgment I saw too often."

When asked if she was referring to the bad judgement of Carmen Ortiz, Gertner responded, "That's right."