This is an increasingly accepted view. Similar to what I posted earlier. My parents house appreciated 1000% in 30 years, it was worth 10x what they paid. It was an investment that paid for every car they ever owned and expensive college educations for two kids plus a good chunk of their retirement. I've been in my current house for 15 years and it is worth about 5% more than I paid for it. It is the biggest difference in financial terms between baby boomers and everyone else. Unless your area becomes the next hot market, your primary home is not going to be a good investment in terms of return. It may end up being cheaper than renting if you are there long enough but not if you are moving. Put it this way, the interest on a 300k mortgage at 4% is $515K over 30 years. Your rent would need to be triple your mortgage payment if you exclude appreciation. If you include appreciation of 3%/yr, after 30 years your house will be "worth" 728K - the 515K you paid in interest nets 213K or $591/month in rent equivalent after 30 years. Is your rent going to be $600 more than your mortgage P&I + taxes + PMI + maintenance?
Hard to see on a starter home and even worse for one you plan to spend 5 years in. Homes just aren't the investments they once were.
Build your emergency fund, fund your retirement accounts as much as possible, for the love of God take full advantage of your companies 401K match.
Meet or beat the 50/30/20 rule; Spend no more than 50% of your earnings on stuff you need (housing/food/transportation), 30% on stuff you want (everything else), and 20% on your savings/retirement fund. The last number is the most important if you ever want to be financially independent.