The optimal length for a HT whip antenna would be ¼ λ. A rubber ducky would be preferable, being compact and convenient to use.
The performance of either would be enhanced by adding a ¼ λ flexible-wire counterpoise, popularly known as a 'rat tail' or 'tiger tail'.
A ring-type lug, attached at one end of the counterpoise, would need to be slid over the HT BNC connector before connecting the whip or rubber ducky antenna.