It is taught in every computer science class and written in many books that programmers should not use GoTo. There is even an xkcd comic about it. My question is have we reached a point where the same thing can be said about Eval?
Where GoTo is not conductive for program flow and readability, Eval is the same for debugging, and program execution, and design.
Should using Eval have the same stigma as GoTo, and same consequences as in the xkcd comic?
If anything, it should carry more stigma.
GoTo often creates code that's difficult to maintain. Eval often creates code with security vulnerabilities - that's worse.
Eval has some fairly serious security concerns; if there's any chance untrusted or user-supplied input can end up in an eval, it's vulnerable.
Jslint will warn about usage of eval() in js code run through it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With