Is that true ? Artillery was more useful on defense than offense?
The use to which a particular piece of artillery is put is a function of several factors, notably what kind of trajectory the shell travels, what kind of aiming mechanism the gun has, and whether the target is static or moving (and if so at what speed). Broadly speaking, tube artillery can be classed as either direct-fire weapons (“guns” in the strict sense of the term) or indirect-fire weapons (howitzers) or as hybrids (gun-howitzers). In very general terms, direct-fire weapons shoot a projectile straight (meaning at an elevation of below 45 degres) at a specific target such as a tank, while indirect-fire weapons fire a projectile on a high-arc trajectory (meaning at an elevation of over 45 degrees) at area-sized enemy positions rather than at specific targets.
The classic role of howitzers is to support offensive actions (an example being the massive Russian artillery bombardment which opened the Battle of the Oder-Neisse in 1945), and they’re also handy when conducting sieges (an example being the 1941-1942 German siege of Sevastopol, which was heavily bombarded). This is because howitzers are designed to hit general target areas, and thus are best used against static positions that don’t require precise aiming. They’re not really designed to repel fast-moving forces that are heading towards them (in other words, not designed for use as defensive weapons which protect their own position) because they’re not accurate enough. I assume that a howitzer battery could, in a pinch, try to defend against advancing tanks by laying down a barrage on the intervening ground area being crossed by the tanks, in the hope of hitting some of them by chance, but most of the shots would be wasted unless the tank formation was huge and dense. Furthermore, the howitzers in this situation would have to constantly readjust their aim, something for which they’re not suited. (Modern practice for howitzer use is basically to “shoot and scoot” – set up the weapon at a particular location, aim for the general target area, fire several shells in quick succession, then stand down and move the weapon to a new location before it attracts counter-battery fire).
Generally speaking (since there are always exceptions), direct-fire guns are better suited to defending a fixed position. Fixed anti-tank guns (which are direct-fire weapons) are a good example of this type of application. Their high muzzle velocity is a great advantage in this role: their shells have a very flat trajectory (which makes it easier to hit a moving target like an approaching tank) and their speed gives them excellent penetrating power against armour. WWII tank destroyers (like the Jagdpanther) and heavy tanks (like the Tiger) were also good at this type of defensive work, in which their slow speed wasn’t too much of a problem and their powerful guns and heavy armour were a definite advantage.
Anti-aircraft guns are in a bit of a special category. They’re direct-fire weapons (they fire high-velocity shells on a flat trajectory against specific targets), but they way they’re used nevertheless has some resemblances to an artillery barrage. This is because the targets at which they’re aimed (aircraft) are so small, so fast-moving and so far away that, at the time of WWII, it was virtually impossible to get the kind of “one shot, one hit” results that were achievable against tanks (and that are achievable today with surface-to-air missiles). To hit the target, you had to combine the high-accuracy shooting capabilities of direct-fire guns with the large volumes of shellfire usually associated with howitzer barrages.