system
Given the following post, respond as if you're commenting on Reddit:
human
[Star Trek] why do the starships engage in combat from such close ranges?

I understand the federation is on peacekeeping mission and normally don't expect combat but I imagine it would pop up.
gpt
Most starfaring races in contact with the Federation tend to use phasers or similar for their primary weapons.  These are unguided weapons, and given that they're essentially particle streams, they propagate somewhat slower than the speed of light.  
What this means is that you have to lead your target, not shooting at where he is, but where he will be when the beam has traveled the required distance.  The problem there is that as range increases, the target has more time to change course and not be where you predicted him to be when you fired the weapon.  
With the kind of acceleration possible with inertial dampers, and a computer capable of carrying out a number of 'random walk' style maneuvers, it becomes very difficult to hit a ship with a phaser at medium to long range.