4 ms·
As a devils advocate. 1. How many times are we going to have to debug and rewrite code to work around this defect? If it were just this once sure add the the
by stonemetal 15y ago
As a devils advocate.
1. How many times are we going to have to debug and rewrite code to work around this defect? If it were just this once sure add the the ';', unfortunately it is never just this once.
2. How much time will be saved by using a minifier that actually supports the javascript language. What other language features will break because someone didn't feel like supporting javascript in their javascript minifier?
3. How much mental effort is needed to support half a dozen different minifiers that all support a different subset of the language as well as the cross browser differences we already have to take into account.
It is a matter of trust. If your tools skip supporting language features because someone decided they didn't like language feature X, what other corner cases did they skip because they were unliked?
- stcredzero 15y agoHow much time will be saved by using a minifier that actually supports the javascript language. How much time would be saved by widespread use of "The Good Parts" of Javascript? This is likely to be much larger than the time you propose. How much mental effort is needed to support half a dozen different minifiers that all support a different subset of the language Who says you have to? If the community as a whole started omitting the hairy parts of the language, they would tend to converge on the same core. A superset of the 5 or 6 most popular subsets is still going to be a lot cleaner than the whole hairball. In practice, this is about the coverage that just about any language gets from tools like compilers and code transformers -- after all, the serious tools pretty much all have bugs. A superset of the 5 or 6 most popular language subsets is all anyone gets in practice.
- jeltz 15y agoAnother advantage of the minifiers with a correct understanding of JavaScript is that they can do way more advanced minifications like shortening variable names.