JavaScript Magic
[draft] Imperative vs. Recursive vs. Functional
Imperative vs. Recursive vs. Functional
[ Work-in-progress ]
Promises: Awesome!
- While, native ES6 Promises are great, I prefer the robust Bluebird Promise Library.
- Library or not, modern browsers have supported Promise for years.
- Promises can be utilized without crazy patterns - implicit
deferred
is preferable. - $q just sucks just use bluebird, see above.
- Worth mentioning: Bluebirds Benchmarks are best-case tests, so take note if doing crazy fancy promise chains
Java vs JavaScript
Rate Limiting / Debouncing / Throttling
- In JavaScript David Walsh implemented debounce in less than 20 lines!
- In Java, JDebounce, an library which is a lot more complicated, at ~500+ lines.
- _ Comparing the two: _
- The JavaScript is fast & uses first-class functions to achieve brilliant simplicity.
- Whereas the Java has many more moving parts, annotations are used to apply behaviour at compile-time, and there’s a ton of XML, just for funsies!