19 karma · joined Mar 25, 2013 (13y ago) · 8 submissions
comment 9y ago · link · parent
More generally, javascript functions accepting any number of parameters, regardless of those specified in the function declaration, is quite error prone when passing functions around.
I always use anonymous functions or 'bind' to explicitly match the parameters unless all functions involved are curried.
The other reason to avoid passing 'naked' functions around too happily is the behavior of this.
I also find most optimizations to focus on simple, explicit code. Nothing like using the less common, more dynamic features of the language to hit deoptimizations.
comment 9y ago · link · parent
Immutable makes it clear that the server won't update the resource in place and will handle updates by generating a new one so the browser can happily avoid checking those resources on page refresh.
comment 9y ago · link · parent
Another solution would be to use an unpredictable versioning scheme so the attacker can't anticipate the name of the resources.