If you change the front first you will spin wildly while trying to adjust the rear, causing you to lose precious momentum. With practice you will learn how to anticipate when you need to start shifting. You should always try to make gear changes to go uphill before you start having trouble pedaling. As a local rider says "shift early, shift often." And don't forget when going up you have that little ring on the inside to use. In others words, don't be afraid to use all the gears you have......that's what they are there for!
"Only those who dare to fail greatly can ever achieve greatly" (Robert F. Kennedy)