The stack overflow page is disappointing because in my opinion all of the answers miss the point: Yaml is designed to be readable and editable by humans. Json is only designed to be human readable - and intentionally does not have features to support editing by people.
Json intentionally does not support comments. Think about that for a bit and you'll realise what Json is for and what it isn't for.
As SeoxyS said: use yaml for config files, Json for APIs.