Skip to content

Instantly share code, notes, and snippets.

@doctorpangloss
Created July 17, 2013 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctorpangloss/6016559 to your computer and use it in GitHub Desktop.
Save doctorpangloss/6016559 to your computer and use it in GitHub Desktop.

###Pros:

  1. Correctly uses inheritance, for the most part.
  2. Good namespacing.
  3. JavaScript properties are sort of advanced. Nobody uses them though.
  4. Good formatting.
  5. Completed sections are all error-free on their returns.

###Cons:

  1. this.name = n ? n : ''; is totally weird. If it's supposed to be a default value, it should be n = n || '', but '' is null anyway, so it would seem that it should actually say null and not '', which would be an untitled vehicle (?).
  2. Generally, JavaScript classes have parameterless constructors.
  3. Overkill with the property getters/setters that are incorrectly overridden, so it confuses the intepreter. E.g.: Scopely.Instances.Motorcycle {name: "", name: "", _seats: 1, _wheels: 2, info: function…} from Chrome.
  4. info() could benefit from a knowledge of underscore's omit.
  5. I wouldn't scope this either, but it would be nice.
  6. All the funny JavaScript properties and setters. Just not very idiosyncratic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment