for me it's about surving the climb and recovering for the next bit of roadway. if you've got a series of rollers it's different than 1 killer hill. also what's on the other side matters a lot, will it be a descent that you can coast down or a continued extended slow climb? a level road? some climbs you can expend yourself more on and others you'll need to conserve and just survive. it helps to get a regular route. then you can experiement and find out what you are good at and what you need work with. after some time you can do some climbing out of the saddle. a good rule of thumb is if you think you want to get out of the saddle first upshift 2 gears. mashing isn't good for anything, you're gonna get a leg workout, there's no need to crush in a gear that's too high.