3 ms·
I believe this code is painfully unreadable - and that's despite the fact that CoffeeScript is very elegant and easy to read. (It's not you, it's async.) Furthe
by malgorithms 15y ago
I believe this code is painfully unreadable - and that's despite the fact that CoffeeScript is very elegant and easy to read. (It's not you, it's async.) Further, maybe i'm misreading this, but it appears getPersonality and getLastTalked are fired in serial. Can someone who knows CS well fix that and reply? Thanks!
- Cushman 15y agoAh, that's a good catch. Missed that. Calling those in parallel is legitimately a hassle to roll yourself, something like: ... isPicAVampire thumb, (is_vamp)-> unless is_vamp mate = userid: u, thumb: thumb finish =-> return unless mate.personality? and mate.last_talked? soulmates.push mate if soulmates.length >= 10 cb(mates) else soulmates(buffy, cb, mates) getPersonality u, (p)->finish mate.personality = p getLastTalked u, match, (lt)->finish mate.last_talked = lt Anyway, I'll grant you that code is pretty harsh. It's much nicer with syntax highlighting and wide tabs, but still, fair cop. The flip side is that that code compiles into JavaScript that does exactly what it says.