Combat in later Star Trek was increasingly unrealistic. In the original series, starships were battling each other at tens of thousands of kilometers. In the episode "The Ultimate Computer", the Enterprise engaged her sister ships at 200,000 kilometers. In the later episodes, ships were engaging each other at point blank range. As shown in the TOS episode, ships had better maneuverability at this distance. And this is closer to reality where fighter jets can engage in tens of kilometers. Targeting systems adjust for the enemy's ship movements so that the fired missile can hit successfully. (The only aspect I could never understood is how the life support systems on the Excalibur were destroyed, resulting in the death of all crew members.)
Agreed, episodes post-TOS devolved combat into a point-blank, zero maneuvering affair.
I checked "The Ultimate Computer" and it was not explained what the exact cause of the death of the entire crew of the Excalibur was from. All we know was that the full-powered phaser hits killed everyone on board and rendered the ship looking "dead". In the original FX, it could be explained that the full powered phasers struck the Excalibur from far away and thus did more internal vs external damage. However, the TOS-R revised FX put the battle at point-blank range which should've resulted in the destruction of the Excalibur (like in "Day of the Dove" where the Klingon warship was destroyed within transporter range.)
Which is idiotic, considering Kirk spent most of his time doing EXACTLY that on Organia.
Also regarding sneak attacks, Kirk specifically mentions Federation starships
. In "Errand of Mercy", Kirk and Spock had no problems doing sneak attacks on the ground which doesn't contradict his statement to Kang in "Day of the Dove".
KIRK: Federation ships don't specialise in sneak attacks.
I think a realistic combat distance for a starship would be between 100 and 400km for phasers, and 1000 to 5000km for photon torpedoes (assuming the torpedoes move pretty damn fast and can cover that distance in five to ten seconds).
We've seen in "The Changeling" a photon torpedo with a flight time of ~6s strike a target to the side and slightly behind the Enterprise at 90,000km. If it was straight ahead it probably would've been a shorter flight time. In TOS, it doesn't appear an issue to engage targets 10s of 1000s of kilometers away as common ranges and "extreme" and "maximum" ranges reaching to several au. Even in The Motion Picture we see the Klingons taking torpedo shots at V'ger at 1au (or 40au depending on the version).
On the other hand, its clear to me that there are technological differences in the TNG continuity that probably would suggest close range combat. Their sensors don't appear to work well against ships at warp while at sublight since "The Picard Maneuver" is a viable tactic. So in the TNG-continuity, realistic ranges for them would be phasers under 400km and torpedoes a little further.
Or then again, we do have the Phoenix vs the Cardassian warship and that was at 200,000+km engagement ranges. <shrug>