Either will work, so I wouldn't say one starch is better than another in this case. If you use flour, bring the pudding to a boil and allow it to boil for 20-30 seconds. If using cornstarch, you'll want to boil the pudding for a solid 2 minutes. The only real way one is better than the other is if gluten is an issue for you. In that case, you'll definitely want to use gluten-free cornstarch as opposed to wheat flour which contains gluten.