Usually Stealth Is Better
When it comes to effectiveness in actively conducted combat operations, against "near peer" opponents, stealth is usually the clear winner.
Attack submarines greatly outmatch surface warships in naval engagements.
The vast majority of air to air combat incidents (and the vast majority of kills by "fighter aces" in the post-World War II era) are one shot, one kill engagements where the air to air missile that will shot down the loser is in the air before the winner even realizes that an air to air combat engagement has begun.
In air to ground attacks, stealth fighters and bombers, low profile armed drones, and long range cruise missiles (especially hypersonic missiles that minimize the window of opportunity for evasive action or active countermeasures) are devastatingly effective against fixed ground targets like bridges, roads, rail lines, missile batteries, airfields and enemy bases, against armored military vehicles like tanks and mobile artillery batteries, against surface ships, and even against large massed gatherings of infantry troops.
The main limitation of air to ground attacks has been the ability to identify legitimate targets and in this reconnaissance role, stealth too has always been acknowledged as critical. Satellites, stealthy drones, and special operations forces identifying targets with glorified smart phones, and old fashioned human intelligence networks, have been the order of the day.
In terms of strategic forces, nuclear ballistic missile submarines, currently the Ohio class in U.S. service, and long range stealth bombers, currently the B-2 in U.S. service, have always been are more difficult to counter nuclear missile threat than fixed missile silos. In the hands of countries and terrorist organizations with only limited or covert nuclear weapons capabilities, the biggest threat is often not a conventional intercontinental ballistic missile with a nuclear warhead, but a nuclear warhead smuggled into an enemy port on a yacht or fishing boat or in a shipping container, or a "backpack bomb", each presenting a different kind of stealth attack.
The U.S. military has not been insensitive to this development. It has a new generation of long range stealth bomber that basically updates the existing B-2 stealth bomber, the B-21, in the development process. Its "5th generation" fighters, the F-22 and F-35 have stealth designs. It is working on developing a new class of attack submarines to replace the Virginia class. The U.S. military's next generation of helicopters are being designed to be quieter and more stealthy.
Meanwhile, the general rule has been that visible is vulnerable. The U.S. Marine Corps is discontinuing the use of big, slow, easily located tanks. More generally, the U.S. Army and most other military forces in Europe, have greatly curtailed their use of tanks. Worldwide, heavy artillery batteries have been replaced by smaller missile batteries (usually mobile).
While the U.S. has not done so to a great extent (in part, out of a desire to maintain long distance blue sea naval operations rather than short range defensive ones), most of the world's credible naval forces have been shifting away from large major surface combatant ships towards smaller, faster, and easier to hide missile boats and small diesel-electric air independent propulsion attack submarines. The latest U.S. destroyer, the Zumwalt class, the many foreign military frigates, have been designed to have reduced radar signatures.
China and Russia have been working on developing stealth fighters of their own and hypersonic missiles, to replace their fourth generation fighter aircraft (i.e. replacing their counterparts to the F-15 and F-16 in U.S. service).
Showing The Flag
The problem is that the vast majority of the time, active combat between near peers in international wars is not what military forces are called upon to do.
Any time that missiles are launched, bombs are dropped, or shots are fired in combat, the military has already failed at its primary purpose, which is to use the threat of force to influence the actions of other countries and para-military groups, without having to fire a shot.
Military forces looming at a contested border, for example, discourage aggressors from trying to take territory. Warships cruising in contested areas of the South China Sea, or the Persian Gulf, can discourage aggressors from preying on civilian ships.
A roar and flash warning shots from a noisy AC-130 gunship, or A-10 Warthog, or armed helicopter gunship serving as close air support has frequently caused an attacking force of ground troops to back off from attacking in the first place, or to retreat.
Soldiers patrolling neighborhoods, or tanks that take up positions near urban areas in time of civil unrest, and attack helicopters flying over neighborhoods, can restrain or prevent action from military insurgencies.
An amphibious assault ship full of Marines just off the coast of a fragile friendly regime's shores, or a military base on the soil of a friendly regime, can discourage coups against that regime or outside attacks on that nation.
The trouble is, however, that stealth is precisely what one does not want to make a threat of force. The whole point of a threat of force is that you "show the flag" and make a credible threat of military action that your adversary is aware of, that leads to the desired action being taken without any shots being fired and without anyone dying. War is an awful thing, and if a visible and credible threat of force can prevent it, that is a much greater win than prevailing in combat that leads to mass death and destruction (even if that death and destruction is to your opponent).
One of the best justifications for continuing to use large surface combatant warships, despite the fact that they are extremely vulnerable to a wide variety of modern military threats from attack submarines, to sea mines, to hypersonic missiles, to air to surface missiles and bombs from enemy aircraft, to interrupted supply lines of food and fuel, to swarm attacks from small craft, to sabotage attacks while in port like the U.S.S. Cole incident, is that they are an effective way to very visibly and publicly show the flag and communicate a credible threat of the use of military force.
One of the best justifications for big, noisy, non-stealth aircraft like the B-52, or the A-10, or the AC-130, or the Apache AH-64 gunship, or fourth generation fighters like the F-15 or F-16, is that they can be effective ways of showing the flag, either to enemy forces on the ground, or to aircraft considering invading your airspace and threatening your air dominance in a region.
You can't show the flag with an attack submarine. You can't show the flag with a B-21 bomber. Or, rather, you can - this was basically how the MAD (mutually assured destruction) nuclear deterrent strategy worked. But it only works is your adversary is sophisticated enough to recognize that it is there and if some use of the threatened force is not so remote that it has lost its visceral emotional effect with your adversary's decision makers.
The threat of a nuclear attack, for example, has grown to have diminished effectiveness (although it is still considerable) because the last time such an attack was used in real life, in 1945, is now more than 75 years in the past, beyond the lifetimes of most modern decision-makers, and it is increasingly recognized that a country that has nuclear weapons may refrain from using them because the collateral damage to civilians and to themselves through global environmental impacts, may be too high to leave that option on the table.
And, of course, if your showing the flag military assets work well enough to discourage any significant actual near peer combat from ever breaking out, the fact that those military assets have significant vulnerabilities precisely because they aren't very stealthy, may be irrelevant.
On the other hand, it may also be the case, the economic interdependence, rather than the threat of military force, is really what has driven a sustained period without major, international wars between nations with advanced military forces.
Non-Near Peer Threats
Large visible warships and non-stealth aircraft have, for many decades now, been sufficient to discourage warfare between the U.S. and its near peer nations. And, while these highly visible military assets are indeed vulnerable to the sophisticated modern weapons of near peer nation-states, these systems aren't very vulnerable in asymmetric conflicts such as counter-insurgency missions and "small wars" in second-world and third-world countries, whose control over their air space can be wiped out in an instant, and who have no naval resources adequate to pose a serious threat to modern U.S. warships, with which the U.S. has been engaged in actual combat over the last two decades.
The Gulf War, the Iraq War, the initial catastrophic collapse of the Taliban regime after 9-11 in 2001, the missile strikes the U.S. has made on Libya and Syria, and effective joint anti-piracy missions in the Indian Ocean off the coast of Somalia, have all demonstrated in recent living memory that U.S. military capabilities are indeed dominant over developing country and third-world military forces.
On the other hand, the impotent U.S. response to the Russian seizure of Crimea from Ukraine, to border incursions by Russian backed troops in Ukraine, and to Russian involvement in the Syrian civil war, have similarly demonstrated that these forces may not be nearly so effective against "near peer" military forces.
The current dominance of the U.S. over lower tier opponents, however, may be short lived. Increasingly, these countries are gaining access to weapons that are effective against non-stealth forces, like modern anti-aircraft missiles (both man portable and larger batteries), like unsophisticated cheap Cessna aircraft with advanced air to air and air to ground missiles and avionics, like drones and drone swarms, like IEDs, like suicide attacks, like guided missiles, like AI assisted sniper weapons, and like light anti-armor weapons.
What Makes Sense For Military Planners Now?
The question going forward for U.S. military planners is how to balance the vulnerabilities of visible showing the flag military assets that even then are not really vulnerable to non-near peer opponents, with the great combat effectiveness of stealthy military assets.
New military systems that show the flag visibly, while either being less vulnerable to these threats somehow, or by limiting casualties in the early rounds of combat before stealth military resources come to the fore that are survivable, is a largely unrecognized gap and need in military procurement.
I don't have an answer to that question in this post, although I do think that this post helps better focus the process of looking for a solution of this kind.
For example, the general strategy of developing numerous smaller highly visible military assets that keep everything but the "point of the spear" out of harm's way, like missile boats supported by far "over the horizon" tenders ships (or tender submarines), or easily visible military aircraft (since 95% of the personnel that operates a military aircraft is back at a distant airbase rather than in the air in combat), or large visible unmanned systems, all present possible options for this niche requirement.
Of course, another cheap and easy way to "show the flag" with more stealthy military assets is to disavow a tradition of secrecy by selectively lifting the veil of national security secrecy that has been instinctively applied to these military assets.
The military can, instead, publicly display the effectiveness of stealthy military assets in missions that are secret when carried out, or are training exercises, or even in realistic fictional portrayals of the use of military force, so that potential adversaries are aware of these threats enough to be influenced by them, even though they aren't literally visible. To some extent, this is already being done.