Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

FYI, Dart does type checking.

If you want to give your javascript some type-checking, try running it through the closure compiler. This is what we do, and we annotate our methods with type signatures like this

  /**
   * Queries a Baz for items.
   * @param {number} groupNum Subgroup id to query.
   * @param {string|number|null} term An itemName,
   *     or itemId, or null to search everything.
   */
  goog.Baz.prototype.query = function(groupNum, term) {
    ...
  };
And then the Closure Compiler tells us if we've broken some type contracts.


> FYI, Dart does type checking.

According to the official docs [1], it does not: They have no effect whatsoever in production mode.

Dart does, indeed, have a "checked mode" in which types are checked (I wasn't aware of that before).

In any case, Dart's type system is inconsistent (like Java's), intentionally, but I still don't think I could be called "static".

[1] https://docs.google.com/document/pub?id=1RqcfL64kw5SJkyut6eN...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: