As with every investment, the answer to "what is the best" for each person "depends." I bought my properties 25 and 15 years ago, but the world has changed a lot in that time. I think it is ridiculous to make a blanket statement what is better or worse for all people. The answer for a 25 year old holiday hotel manager is not the same for a 25 year old chemist working in a major laboratory.
I looked up information for where I was living and found a rough formula comparing renting to buying. The formula said that if I planned to live in that place for 7 or more years, it was better to buy. Fewer than 7, renting would have been cheaper.