There are numerous areas in the fitness industry which, until recently, were shrouded in mystery. This is one of them. Despite the fact everybody knows someone who has some fitness knowledge, until very recently the answer to this question was based entirely on personal opinion because there weren't sufficient studies to give a definitive answer.
Now science has provided the answers people were previously unable to get. We'll be looking at the findings of two studies in particular and analyzing why performing cardiovascular activity before a resistance workout was recently proven to be far more effective. 
That's not to say you can't get results the other way too, obviously. But recent studies at the James Maddison University found that case studies doing their resistance workout first were unable to keep up with case studies who were getting through their aerobic exercise first. When it came to building lean muscle, the 'weights first' group found that their progress was substantially blunted in comparison.
When it came to fat loss, the results were very similar. The Journal Of Strength And Conditioning recently commissioned a study which discovered that fat loss results were substantially higher by performing aerobic activity prior to resistance training.
Those facts may be controversial to many fitness enthusiasts, who opt to perform their resistance training first. The theory behind that method is that they don't want their muscles to be tired by aerobic exercise when they begin pushing out repetitions. This makes sense and it's an approach which does yield results. However, science suggests that switching them around is far superior for both fat loss and lean muscle development.
There are two key enzymes which play important roles here:
* AMPK (aka adenosine monophosphate-activated protein kinase)
* mTOR (aka mammalian target of rapamycin)
You may have heard of these before. AMPK is the enzyme responsible for helping the body adapt to endurance exercise, while mTOR is considered an 'on' switch in the muscle building process. After you finish a weights workout, your mTOR levels surge for around one hour. This means consuming quality nutrition at this point will ensure quality lean muscle gains. After around six hours, levels of mTOR return to normal. 
The two enzymes aren't exactly the best of friends, in fact AMPK switches off mTOR substantially. So by staying in the gym after the end of your resistance workout to jog on the treadmill for half an hour you are missing most of your golden post-workout window for nutrition and also turning down the body's spike in mTOR.
So, should you do cardio before or after weights? Whether you want to learn how to lose weight or how to pack on lean muscle, recent science is heavily on the side of performing your aerobic activity before you pick up a dumbbell.