Regarding the difference between the two it all comes down to your Effective Marginal Tax Rate (EMTR), which is to say your total taxes PLUS clawbacks of government benefits.  This tells you what the NET benefit is of the next dollar of income you earn (or, perhaps in a real-world example, "What would be the net benefit of working this extra shift that would pay $100 before taxes and clawbacks").

If your EMTR is higher today than it will be in retirement, RRSPs tend to be better.  If your EMTR is lower today than in retirement, TFSAs tend to be better.  If your EMTR is the same now and in retirement the tax benefit of an RRSP vs. TFSA is exactly the same, though I prefer TFSAs for their flexibility.

The tricky part of this, of course, is calculating your EMTR.  Taxes are easy but figuring out all government clawbacks now and in the future is not an easy task.