Ask what pulls on it
Assume a fitter will hang a tool off the harness at some point. The connector needs a latch you can feel, and the cable a strain relief that takes the pull before the contacts do.
On the outside of a box we use M12 circular connectors with a threaded coupling. They hold when pulled and seal when tightened.
Moisture and dust
An IP rating only counts when the connector is mated. A socket left open through a monsoon will corrode, so spare sockets get sealing caps. Tin contacts are fine for 24 V power. For millivolt signals from a load cell they are not: in a humid shed a tin contact can add 40 ohms, invisible on a 4 to 20 mA loop and ruinous on a bridge.
Vibration
A friction-fit pin header walks out of its socket on a machine that vibrates. We use headers with a latch or a screw flange.
A heavy connector on a PCB loads the solder joints, so it needs its mounting tabs or an extra screw. A board connector that takes a cable pull is the commonest crack in field units, and it shows as a fault nobody can reproduce on the bench.
Crimps, not solder
A hand-soldered contact fails where the solder wicks and the wire turns stiff. A proper crimp holds strands and insulation together. The tool must match the contact: a generic crimper on a JST or Molex pin gives a loose crimp that fails within a year.
Label and key
Two connectors that look the same will be swapped. Different coding or pin counts make a wrong mating impossible; where that can’t be done, both ends get a printed tag.
What we avoid
Screw terminals on anything that moves. Barrel jacks on anything that matters. Ribbon cables in a vibrating box. USB-A on a panel. Any connector we can’t buy again in 2 years.
Decide all of this before the panel is cut, because changing the connector later means changing the hole.