The idea that leaving the power cord plugged in all the time is bad for battery life is something left over from the 90s and early 2000s. It simply doesn't apply now, unless you're buying dirt cheap products with no reputable brand name.
Here's how it works from an engineering perspective. After your power cord is plugged into the computer, the wiring splits into two paths. One leads to the battery while the other goes straight to the logic board. Obviously this leads to 4 possible combinations of distributing power.
1. Computer is off, plugged in, battery not fully charged. All the power from the outlet goes to the battery and it charges much faster.
2. Computer is on, plugged in, battery not fully charged. Power is distributed accordingly between charging the battery and powering the computer. The battery will charge slower.
3. Computer is on, plugged in, battery is fully charged. All the power will go to the computer, bypassing the battery.
4. Computer is off, plugged in, battery is fully charged. No distribution of power, except for what it takes to power the green light on the MagSafe.
Back in the old days, there weren't two paths for the power to travel after entering the computer, so the power always had to first go to the battery and then from the battery go to the computer. Thus, if you left the power cord plugged in all the time, you were effectively charging the battery to 100%, using it to 99%, charging it back up to 100%, and so on. There were also problems with overcharging the battery, but that's another story.
Nowadays, it's no longer a problem, so you can leave your power cord for most electronic devices plugged in all the time unless it EXPLICITLY tells you not to, or if you bought a dirt cheap product that uses the old engineering method to save a few cents.