2 ms·
Hah. Wish I'd thought of some of these for last year's http://10k.aneventapart.com http://10k.aneventapart.com . I tried to write most of my JS for 10k 'pre-mi
by orls 15y ago
Hah. Wish I'd thought of some of these for last year's http://10k.aneventapart.com http://10k.aneventapart.com .
I tried to write most of my JS for 10k 'pre-minified', using tricks akin to (but not as awesome as) these. Echoing other commenters, it was largely as an intellectual exercise (to see if I could meet the 10k limit by hand) but it did make me think of a few things in a different light, and some of the 'optimizations' are things that minifiers wouldn't have done for me.
It's also a good way to get under the skin of a language, get a feel for the nuances of how the runtime behaves, and give you hints for other (more generally useful) optimisations.
- jedschmidt 15y agoIt's also interesting to see how the approaches differ at each order of magnitude from 140byt.es to JS1K to 10K Apart. At the smallest end you really have to work with what you're given and triage fast, whereas with JS1K you see people writing decompressors _in_ their code to get around JavaScript's occasional verbosity.