There is no right or wrong way but it is designed to ensure that shifters work efficiently with the derailleurs. The route of shifter cable is determined by the cable routing and stops on the bike.
Using the Hardrock as the example there are two cable routes and a brake line route under the top tube. The shifter cables sits to the right of the the brake line and the order from the right is FD-RD-RB. The FD cable needs to sit on the right to allow the correct angle to run down the back of the seat tube. As the front shifter is on the left side and rear on the right in order to correctly seat in the stops the cables must cross the headtube from the handlebars. The FD and RD cables also cross where the top tube and seat tube meet.
By default the brake line is on the left, in many right hand of the road driving countries the rear brake will be on the right hand side and therefore you have no choice but to cross the head tube.
I have a bike that has no crossing at the head tube apart from the front brake line which doesn't rub. The cable set up from the right is RD-RB-FD. This actually causes more cable rub on the headtube than one that crosses.
I don't worry about cable rub, I own bikes to ride, not look good or retain resale value.