Hammering on the cotter pins can damage the bearing surfaces on the spindle and cups and balls, unless the crank arm is well supported; that's why methods and tools that press out the cotter pin are the first choice. Once you get out the hammer it raises the risk to old components that are hard to replace.