Both of them have their own advantages, but which one to choose depends on many factors, like which ad network/ affiliate network you choose to work with. But personally i feel affiliating marketing is the best way to earn money, because its payouts are rather high compared to ads and it is more easy to setup and manage, one another added advantage in affiliate marketing is you can also promote your affiliated products on social media directly, this helps in increasing the percentage of your conversion which in turn increases you income. While in case of advertising, you only get paid for the ads that are displayed on you web page, and the payouts are very low compared to affiliate marketing, ad systems pay through you formulas , CPM, CPC , that is they pay a fixed amount of money for every thousand impressions created while the ads are active on your web page and these cpm rates most of the times does not cross 2 dollars, so advertising is not recommended for sites with traffic below 5000 views per month.