Hacker News new | past | comments | ask | show | jobs | submit login

|with| makes reasoning about function behaviour extremely difficult, take:

var x = 5; something.propertyOnSomething = 5 with(something) { x += propertyOnSomething } alert(x); // What is the value of x?

eval() causes problems as it can introduce new variables into the local scope making it logically difficult to reason about program behaviour subsequent to the eval(), e.g.

function f(x) { eval(something); return Math.sqrt(x); }

What is the result of f(9)?

It is possible to set things up to make these not catastrophically harm performance, but the question is whether you would rather the engineers working on these engines make uncommon (and arguably bad) things common, or make normal and frequent code fast. Any time spent working on making uncommon things fast is time not spent making other things fast.




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

Search: