Indeed, it's hard to say which one is worse: in-universe space cadets who don't know that space has three dimensions, or real-life professional science fiction writers who don't know that space has three dimensions.
It's hard to say in terms of which one is "worse", as you say, meaning which one is more pathetic. However, personally, I know which one I consider worse, meaning which one I can tolerate. I can swallow writers getting things wrong much easier than I can accept the idea that in-universe, people are just that dumb. Things like having supposedly well-trained officers demonstrate zero tactical aptitude due to lazy writing, or when Data uses his super-fancy positronic brain to calculate some very high level math and gets the answer
wrong (and no one corrects him)... The way I look at those kinds of writing mistakes is to just say "Well, if Star Trek were 'real', that wouldn't have happened quite that way, since it makes absolutely no sense." Works very well.
All that said, as far as I can tell, Star Trek combat is more like Fail Safe than Midway, and Starfleet relies on a widely distributed second-strike capability, apparently assuming that Earth could not be defended against a cloaked warbird intent on actually glassing the place, and also that no enemy homeworld could, either.
I will say that
this always bugged me. I find it beyond impossible to believe that the defenses for Earth would be as lame ("lame" in this case boiling more or less down to "defenses?") as we are shown.
Then again, it makes you wonder why the Dominion didn't, since they had absolutely nothing of value to lose (hell, they glassed Cardassia themselves!). The real reason, of course, is that Earth is basically plot-invulnerable in Trek, despite having nearly zero relevance to 99% of all Trek stories, despite not being of great in-universe value because of the billions of off-world humans and dozens if not hundreds of human colonies, and despite rarely being interesting at all.
Well, to be fair, the Federation and Starfleet do keep their HQ there. One has to assume that if Earth fell, neither the Federation government nor Starfleet Command would just immediately be thrown into a state of decapitated chaos; there have got to be contingency plans involving government and military infrastructure in place on other worlds (Vulcan or Andor, perhaps). That said, even if you have backup plans, your primary HQ going under would have to suck, so Earth at least has in-universe importance. And personally, I'd like to see Earth a little more directly
involved in some way in a Trek story or two.
All of that said, I think the boat has been sorely missed by the OP with regard to the "weakness" of Starfleet (both in terms of their effectiveness as a military, as a whole, and in terms of the power of individual ships).
Nasat sums up the difference between "non-militaristic" and "weak" beautifully.
The Dominion War doesn't count because they only won because of the help from the Klingons and Romulans.
Unless your claim is "Star TREK military forces are weak" (meaning not JUST Starfleet), this isn't relevant, because without the Federation, neither the Klingons nor the Romulans would have had a shot in hell against the Dominion, either. And the real reason it took all three of them is just because the Dominion is HUGE. Which brings me to...
I agree that the Battle of the Line was basically Earth getting bitch-slapped. But that was mainly due to Earthforce being centuries less advanced than the Minbari in terms of technology. But unlike Starfleet, B5 ships are designed for combat. Starfleet ships are only desgned to handle small space battles.
So the Minbari being far more advanced technologically excuses Earthforce getting their asses
kicked by them, yet the immense size and strength of the Dominion military (and their initial ability to shoot through Starfleet shields like they weren't even up) doesn't excuse Starfleet needing allies to win the war?
And no, Starfleet ships aren't designed to handle "only small space battles." Starfleet as a
whole needed allies to win, due to being grossly outnumbered, but individual Starfleet ships did fine in large fleet battles against Cardassian and Jem'Hadar ships. They
wouldn't have won the war otherwise.
Besides, at the VERY least (as
Nerys pointed out), Starfleet > Imperial Stormtroopers.
