Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun...
by defined on Friday September 29, 2017 @01:10AM
(#15362852)
This would be an entertaining comment when read by a C programmer:
Pre- and post-increment operators are bread and butter in C, hardly overly clever. Are they a recent addition to JS?
[ Parent
| on HN ]
Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun...
by nikkwong on Friday September 29, 2017 @03:05AM
(#15363348)
Nope.. They've been in JS since the early versions of emcascript. JS is often used for more web-appy stuff than actual math so I wouldn't say they're used very abundantly, which may explain the comment.
Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun...
by barryhoodlum on Friday September 29, 2017 @04:28AM
(#15363646)
On top of that, he could have just written "currentChunk++;" and skipped the comment entirely.
Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun...
by J-dawg on Friday September 29, 2017 @07:33AM
(#15364374)
wouldn't that return the value of currentChunk before it was incremented? So it would need an additional line to be equivalent to the example (making it a bit more readable in my opinion):
currentChunk++;
this.chunks[currentChunk] = [];
Which is perhaps what you meant all along. Please excuse the pedantry.
Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun...
by barryhoodlum on Friday September 29, 2017 @12:22PM
(#15366642)
Yeah, that's what I meant - instead of taking the shortcut with a comment explaining it, just don't take it in the first place.
Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun...
by Kiro on Friday September 29, 2017 @04:16AM
(#15363591)
Not only when read by a C programmer. I'm a JS programmer and I don't understand what's "overly clever" about something you learn in JS 101.