I think Sample code has its value. It helps you learn stuff rather quickly. Just because some people push sample code to production does not justify not providing/ using sample code in the first place.
But to agree with you, thanks for spotting the perils of sample code. I guess it can be used as a gentle reminder to every one using sample code...