Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

node.js is the new java

Name: Anonymous 2012-09-09 8:35

it greatly improves on it's predecessors
familiar syntax
it's designed to be practical, to the chagrin of CS purists
next-generation of applications being built (hadoop, palantir, runsecape :  asana, meteor)

Name: Anonymous 2012-09-09 12:49

>>5
Lexical scoping in JS would be okay if there was a let statement so you wouldn't have to do

  for (i = 0; i < N; i++) {
      (function (item) {
          add_event_handler(function () {
              /* use item, can't use items[i] since i it contains a new value */
          });
      })(items[i]);
  }


The distance between where the name item is introduced and the place it is assigned is not good.

Instead it should look something like this

  for (i = 0; i < N; i++) {
      let {
          var item = items[i];
          add_event_handler(function () {
              /* item is a new lexically scoped name and is invisible outside of the let block */
          });
      }
  }

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List