News for hackers. Stuff that matters.
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:

    // Overly clever way of saying: increment `currentChunk` then use the incremented value
    this.chunks[++currentChunk] = []
Pre- and post-increment operators are bread and butter in C, hardly overly clever. Are they a recent addition to JS?
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.
Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun... by J-dawg on Friday September 29, 2017 @07:39AM (#15364407)
Although the post-increment (x++) operator was part of 'JS 101' for me, I've never knowingly seen the pre-increment (++x) operator before. TIL.
Re:Show HN: Hivemind – Distributed jobs using AWS Lambda fun... by madamelic on Friday September 29, 2017 @08:32AM (#15364645)
The comment was a bit tongue-in-cheek, but I'll accept that I oversold it.