Right way to build some version of project

I am a little confused. There are a couple ways to build 2 versions of same project; for example for pay- and free- or pro- and light-, or change some strings resources. I saw 1st way like this http://stackoverflow.com/questions/17465353/how-to-replace-a-string-for-a-buildvariant-with-gradle-in-android-studio/17572644#17572644 - xchange strings by using tasks, 2nd way is use buildTypes, where we should set up paths to release and debug versions or makes replace of strings task .and last way is productFlavors. I think that last one is more correct. Which one of these is more practical?

You should prefer variants (i.e. flavors and buildTypes) wherever possible.