Bill Cosby and Donald Trump have a few things in common: They are seemingly wealthy old men who have been in the public eye for a long time.

Another commonality is that the actor-comedian-raconteur just got out of prison and, depending upon developments, the former president may be heading there. Their legal trouble is attributable to a pair of criminal prosecutions run amok.

Cosby was released from incarceration in Pennsylvania a few days ago following a ruling by that state's Supreme Court that his 2018 conviction for sexual assault was wrongfully procured by an overzealous — and unlawful — prosecution. Years earlier, the court found, the state's prosecutor, Bruce Castor, had promised that, due to "insufficient" evidence, Cosby would not be charged with any crimes. That determination led Cosby to acknowledge in civil proceedings brought against him by women, including one by Andrea Constand, that he had committed sexual assaults — rather than invoking his constitutional protection against self-incrimination.

Cosby's concessions in those lawsuit proceedings made possible his subsequent criminal prosecution, which landed him in prison these past three years.

The court's decision was a scathing rebuke of prosecutorial wrongdoing, calling the prosecution of Cosby a deviation from due process and from "fair play and decency" despite Cosby's own misdeeds.

Trump, for his part, is a free man and may remain so, despite a wrenching three-year investigation of his finances and those of his various business enterprises by the outgoing district attorney in Manhattan, Cyrus Vance. Jr, a Democrat. Two days after Cosby left prison, the New York inquiry, which had involved multiple trips to the U.S. Supreme Court, unveiled an indictment for tax improprieties by the ex-president's anchor company, and its long-term chief financial officer and Trump loyalist, 73-year-old Allen Weisselberg.

The charges against the Trump family organization were based upon an alleged 15-year scheme of failure to report and pay some $1.7 million in taxes for fringe benefits — such as vehicles, free rent and school tuition — for Weisselberg's grandchildren.

The charges were anti-climactic and underwhelming to many observers, especially anti-Trumpists and much of the media, who were expecting — and hoping for — much more severe accusations as well as charges against Trump himself. The former president's foes are buoyed a bit by the continuing nature of the investigation, along with the possibility — so far resisted — that Weisselberg will "flip" on his boss and give the prosecutors the ammunition they need to indict, convict and possibly imprison Trump, which so far seems wanting.

The way the prosecution team has tried to induce Weisselberg to turn against Trump in its charges and media leaks preceding and accompanying them has been unseemly — bordering on irresponsible bullying.

While the lengthy New York criminal inquiry, one of several circling Trump, appears methodical, it has been, like the Cosby case, stained with other improprieties.

The charges themselves seem trumped up. While tax evasion is a serious matter, alleged offenses of this type usually are handled without jail time — pay the amount owed, plus interest and fines.

The intensity of the inquiry seems to be targeted against Trump because of who he is, rather than what he and his coterie might have done. It reeks of a quasi bill of attainder, an archaic form of legislation aimed at a particular person and expressly forbidden in the U.S. Constitution.

The unusual criminal charges also seem to reflect desperation on the part of the New York prosecutorial team. They carry an air of having to do something, anything, before Vance's announced retirement at the end of 2021.

That Trump himself has not been charged, at least yet, may redound to his personal and political benefit. Many will say that the absence of more serious charges against any of his business entities or against him personally constitutes a form of exoneration. What business organization, especially a sprawling, multifaceted one like his, they say, could withstand such intense scrutiny without yielding more than relatively minor league tax scofflaw offenses?

That the Trump tax tussle is imbued with political overtones is beyond cavil. Indeed, in the election held last month those running to succeed Vance frequently addressed how they would handle the Trump matter. The victor, Alvin Bragg, boasted of his anti-Trump credentials while with the state attorney general's office. He bragged that he was the most adamant about tightening the screws on the former president and his cronies.

A similar political hue infected the Cosby case. The absence for a number of years of any criminal proceedings against him by the elected county attorney had been a major topic in the election campaign to succeed him. As in New York City, the winner was the one who promised the most vigorous prosecution and, once in office, delivered upon it, which turned out to be the one deemed vastly improper by the Pennsylvania high court.

Neither Cosby nor Trump is out of the proverbial legal woods yet. Cosby may still be sued by some of the women he allegedly abused, although the statute of limitations for those claims may preclude them from proceeding. Trump still may be subject to prosecution as the Manhattan inquiry proceeds, particularly if Weisselberg does indeed "flip" against him.

But the overriding feature of these two criminal proceedings is the infirmities of the respective prosecutions. One is reminded of the oft-quoted admonition of late 19th-century Prussian leader Otto von Bismarck: "Laws are like sausages; it's best not to see them being made."

The same may be said of high-profile criminal prosecutions.

Marshall H. Tanick is an attorney in Minneapolis.