Ideally, you want to use the battery sometimes but not excessively.
Leaving a battery fully empty or fully charged (or not fully charged but plugged in) is usually bad in the long term. You need to charge and discharge the cells to prevent false readouts from cells, and leaving a battery either empty or full for long periods can both cause problems
On the other hand, batteries have a certain lifetime, measured in charge cycles - typically losing around 20% of their charge after 500-1000 cycles. Different batteries degrade at different rates, but the theory still stands, meaning that after 3 years you should be at around 70-80% of your original charge.
Typically it's good, once a month, to charge the battery to 100%, use it down to 0%, and then charge back to 100%, to allow the circuitry to calibrate the battery and keep the readout accurate.
A particularly bad usage is to try to keep your laptop plugged in, but randomly take it off for 10 minutes, forcing it to constantly charge/discharge 5% of the capacity.
For the most part, though, I'd recommend "just using it". If you need to be on battery, be on battery, otherwise keep it plugged in, and use it off battery for a few hours a week, doing a full cycle once a month.