But...hard building artillery, in my humble experience, isn't very effective either. If they get artillery in the time it takes you to build it and get it to their door, it's worse than going at it with cannons. Due to their indirect attack and need for vision which is easy to get in your own boarders, Artillery make for painful units to try to advance against.
Hard building Artillery wastes the one big advantage you get from grabbing Dynamite when you can, having the superior army from that moment for a little longer.
If you aren't after that advantage, it's probably almost universally better to work the middle and top of the tech tree, which often means Gatlings as your best land unit for nearly a full era, nearly as strong as Cavalry (from a better tech), without the drawbacks of being a mounted unit and without taking damage when attacking.
If everyone has Artillery, funnily enough, Artillery is trash.
For their era, Gatlings are a pain to take down, only a few things have higher strength, they take no damage when attacking. Artillery is torn apart by anything that can get to it, including other Artillery, so hard building it isn't a real option except for defense.
Of course, this only goes for games that are competitive. If you're a full era ahead of the AI, you can beeline GDR's, hard build them, and win...but when a game is close in tech, the edge of Artillery is too important to build in cities. Dynamite is one of those techs that, once you hit it, the clock's ticking.
Gatlings getting that nice upgrade and their defensive abilities roughly on par with Artillery make them a better use of hammers, in my mind, due to the fact tey don't go out of style so quickly.