Also, to provide everyone with some further food for thought, infodump post on Combat Doctrine and Sensors & ECM.
Combat Doctrine
The prevalence of sophisticated electronic countermeasures (ECM) amongst all parties, even merchant shipping and pirates, means that while long range shots are theoretically possible, it is discouraged as the presence of ECM means that one's target can 1) hide himself from sensors, 2) softkill incoming missiles, and 3) fire active-emitting ECM drones to decoy home-on-jam missiles.
As a general rule, the best way to generate a constant, consistent targeting solution against hostile ECM is to get closer, as the effectiveness of deceptive and defensive ECM decreases as the range between ships gets closer, and radar, lidar, Electro-Optical and Imaging Infrared sensors become more effective the closer you are. By the time a warship is at the range where ECM no longer "cloaks" the opponent, both parties have entered gun range and are trading fire; as a result there is an opinion among many serving naval officers that long-range missiles and BVR combat is more than a little pointless.
Missiles remain a relevant weapon, but warships tend to use missiles as part of a massed missile salvo in close range. More sophisticated milspec missiles can be programmed to act as impromptu mines; lying in space on passive until receiving a launch order or detecting enemy ships. Pirates have, on occasion, used command-detonated missiles as expensive warning shots.
The universality of ECM on all sides means that against peer opponents, both sides will be roughly equally blind and hidden from each other. Combat involves sending screening elements to scout until the main force is found, whereupon the fleet jumps in to engage. The target force will then either give battle, or attempt to get away via tactical jumping (tacjump). This is where DDs come into play; their drives recharge faster so they can chase their foes and data link back to the fleet, giving targeting data so the other ships can try to snipe you with railguns (until their drives cycle and they can tacjump to the enemy and engage in a slugging match).
The exception is during a planetary invasion, during which the opposing force has corvettes and keeps them in the gravity well of a planet. By design, a tacjump into a gravity well is impossible, it will result in the ship bouncing away from the well and drift for a while before it course corrects. For corvettes, this works to their advantage and they are able to make use of the gravity well to prevent opposing elements from closing the distance, while their ECM prevents long range missile and railgun salvoes from connecting.
Sensors and ECM
When fighting peer opponents, enemy ECM is effective enough that you have to get close to get consistent, constant targeting solutions. However, this is when fighting peer opponents.
The mismatch between milspec and civilian-grade equipment is a lot more pronounced. The simplest way to sum up the milspec vs civilian-grade: I see you further before you see me, I hide me better than you hide you.
Top of the line civilian-grade sensors & ECM are equivalent to milspec sensors & ECM roughly 3-4 generations prior. This mismatch becomes even more pronounced because most civilian ships are not running top of the line sensors & ECM, meaning that the average merchantman's first warning of attack is when a warship appears in WVR and opens fire.
Sensor and ECM effectiveness, using peer milspec systems:
At Very Long Range, ECM in deception mode defeats sensors.
At Long Range, sensors can detect that there is something there, but the contact strength is not strong and there is a high probability the system can be tricked into classing the contact as noise.
At Medium Range, sensors can properly detect that there is a contact and track it, and begin to conduct target motion analysis of the contact's kinematic profile. Engagement with railgun is possible but not encouraged. Track quality is not consistent enough for a BVR missile shot.
At Close Range/WVR, sensors can detect the contact and make a class identification based on radar cross-section analysis, and maintain a constant and consistent lock on the target.
As a result, in order to maintain system-wide sensor coverage, serious players will seed their star systems with listening posts.
Furthermore, while it's possible for a ship to hide itself from sensors, it cannot hide its jump signature: it is possible for a sensor node at Long Range to detect jump signature, even if the ECM completely spoofs the sensors.