If your laptop is going to be stationary for long periods, plug it in and remove the battery.

If you are removing the battery for long periods (week, months, years), check your manufacturer documentation for best storage policy (charge level for storage); all batteries, and all computers are not the same. Similar, but not the same.

Battery technology (charging, usage, composition, etc.) is much better now than it was 5 years ago, and certainly 10 years ago. Stressing over leaving it plugged in or not, battery in place or not, is futile. Leaving laptop stationary for long periods (weeks or greater)...remove battery and store at recommended levels. Otherwise, leave it in. You may lose a couple months on a battery life over a many year period (4-5 years or more). By that time, your laptop is pretty much out-of-date, depending on what you're doing. If it still does what you need and the battery dies, buy a new battery.

Remember, recycle batteries and computers, if you can.