Don't confuse NiCad and NiMH. Both are very different. Suggesting to discharge batteries as a blanket statement is incorrect.
Discharghing NiCad is recommended before recharging. Charging partially charged batteries will cause cell "memory". On the next charge, that low level will be 'remembered' by the battery as the 0 mark, meaning you won't be able to hold as much as a charge. Once that's repeated over and over, the battery basically doesn't hold a charge anymore. Although if you buy newer, quality NiCad, memory shouldn't be an issue even without fully discharging. This is not as much of an issue, but discharging is still recommended as it will extend the lifetime of your battery.
NiMH have a very difference chemistry, and fully discharging them is detrimental to the battery. They're actually better left partially to fully charged. Letting one discharge completely can ruin it over time just like not discharging an NiCad. It doesn't have to be kept at full charge, although that's its happy zone and doing so will prolong its life.
A quality charger is key to keeping your batteries in good condition. Those "wall wart" chargers that come with cheaper guns are best tossed in the trash upon opening the box. They're unreliable, and will cook your batteries if left plugged in too long. A good smart charger with charge detection (that will stop charging once the battery is fully charged) is recommended. Good ones cost more, but good batteries cost a lot too. I would rather pay $100 for a good charger and have my $50 battery last several years than use a cheap charger and have to replace batteries every year.