Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's clearly a proof of concept code focusing on the actual topic, and he begins the code with "Here's an example".


A very important and effective technique in teaching others (regardless of the subject) is to never write or display something that's wrong, because it's often the only thing a student will remember. This is obvious when it comes to language, but it applies to pretty much anything.


Is that better or worse than not teaching anything because your student couldn't pick out the 10 lines of actual functionality among the 100 lines of paranoiaplate in each example?


I take your point but unshift is still correct. One of the reasons PHP has a reputation for being insecure is because there are so many tutorials lying around that show the wrong way to do it. When newbies Google for solutions, they copy + paste what they find, they don't (bother | know that they should) look through it to see if there are any potential security holes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: