You don't trust it more than the top 5 google results. Surely, you wouldn't argue that search engines are useless because not everything that's written on the internet is trustworthy.
For programming, you can just test if it works. That's how most people[1] check if their own code is trustworthy, absent considerations of security against malicious attackers.
In general, knowledge and authority or trustworthiness are different things. I said this makes knowledge worthless. It does not make authority or proof of authenticity worthless; probably, the opposite.
[1]: those who aren't able to always write 100% perfect code on the first try