actually it is really bad to use the battery while you are plugged in to the wall. However, on a different note, never let the battery completely die. (Most computers will turn off with 5% left). Ok now so people don't just think this is only an opinion i will let you know why i said what i did.
The reason it is bad to use the battery while plugged in. Just like in every other part of a computer, HEAT kills. If you use your laptop you will notice the battery is warm. Same if you charge it. If you put those two together they can cause enough heat to damage your battery. Not in an hour but over time. You will start noticing your battery won't last as long. I know from experience.
The second thing is that you should never let your laptop battery die. That is of course if you use Li-Ion (Lithium-Ion) which is a newer technology. The reason most people (especially adults) will tell you to drain your battery is because the only practical rechargable batteries were Ni-Cads(Nickel-Cadmium) and later Ni-MH(Nickel-Metal Hydride). Ni-cads have a thing called memory effect. That is when you recharge a ni-cad battery they "remember" where they were before the charge. Ni-MH have the same effect but it is almost unnoticable. If you want to know you should drain Ni-cads and Ni-MH to about 1.1 volts per cell. Li-ions on the other hand don't have the memory effect and draining them dead will actually cause harm to them. Why do we still use Ni-Cad and Ni-MH if they are so bad you ask? Well as with all technology, even when the latest and greatest comes out, some people still tend to get what is cheaper and in this case, Ni-Cads are the cheapest, followed by Ni-MH and then Li-Ion. I'm just comparing those three. I know I left out other types (Lead-Calcium, Li-Pol, etc.) but these are the most popular in electronics.
Hope that helps.
-Aaron