Some of the guys at the supply counters like to make blanket statements like "installing tandem (piggy-backed) circuit breakers are a code violation". By the same token some of us are naive enough to take this as Gospel truth.
In reality, the statement is partly true and partly false. If you have an older breaker panel that is approved for tandems and accepts tandems then you can add add'l circuits. However, that doesn't mean you can convert a 40 circuit panel into an 80 circuit panel. You can usually find the information on the panel cover door as to whether you can use the tandem or not and where in the panel they can be installed.
On the other hand, if you have a newer panel in a new residential installation where arc fault breakers are installed, you will not be able to use tandems if you have to remove an arc fault breaker in order to add the circuit, irrespective of whether the panel accepts tandems or not.