20 ms·
> (The above is a heuristic example. So you nice people with the pitchforks there, please forgive that I did not protect against SQL injections, etc. I promise
by steveklabnik 16y ago
> (The above is a heuristic example. So you nice people with the pitchforks there, please forgive that I did not protect against SQL injections, etc. I promise that in real life I did. Thank you.)
The newbie who's just copying and pasting your code won't read that disclaimer. Or care. It's still irresponsible, even as a toy example.
- makmanalp 16y agoIrresponsible? People with knives may not know that they cut. People with hairdryers might not now you're not supposed to use them in the tub and people with microwaves might not know you shouldn't dry your cat in it. Now, you argue that people who just lift code off of webpages, without even reading all of it, deserve something. What a stupid thing to criticize.
- chc 16y agoAnd the newbie who's just earnestly trying to learn the topic at hand won't be able to get through hundreds of lines of paranoiaplate with accompanying discussion of the libraries and best practices used in an article on a totally unrelated topic. Blame the blind copy-paste programmers for being idiots, not the helpful author for only teaching one lesson at a time. Tight focus is a good thing in writing. I mean, even if he did all the extra work to avoid vulnerabilities, idiots could just ignore that just like they would the disclaimer and only copy-paste the relevant porton. At some point, we have to acknowledge the programmer's responsibility for his own program.