matatk / audiochart

Allows the user to experience charts on web pages using sound.

Home Page:http://matatk.agrip.org.uk/audiochart/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Function naming consistency

matatk opened this issue · comments

Whilst many objects in AudioChart are private, as in not public API, they do talk to each other. The convention of using _name() for private functions should be used consistently, in order to denote functions of an object that we don't expect anyone else to need to call. They should also not show up in tests (ideally—there are some scoping issues currently that may prevent this [#37]).

Some examples:

  • Player samplingInfo should be _samplingInfo

It would also be good to be able to quickly check whether objects are calling underscore functions in other objects.

Re-opening whilst looking at Sounder tests; should do a pass over all of the source files really...

  • AudioChart.js
  • DataWrappers.js
  • KeyboardHandler.js
  • PitchMappers.js
  • Player.js
  • Sounder.js
  • getAudioContext.js
  • visualCallbackMakers.js

Found some really interesting discussion on private members on StackOverflow, but the good old underscores approach still seems by far the best (simplest, clearest, fastest) here.