W3C home > Mailing lists > Public > public-audio@w3.org > July to September 2013

Re: [web-audio-api] Node creation method naming inconsistencies (#166)

From: Olivier Thereaux <notifications@github.com>
Date: Wed, 11 Sep 2013 07:30:05 -0700
To: WebAudio/web-audio-api <web-audio-api@noreply.github.com>
Message-ID: <WebAudio/web-audio-api/issues/166/24244627@github.com>
> [Original comment](https://www.w3.org/Bugs/Public/show_bug.cgi?id=18332#4) by Chris Rogers on W3C Bugzilla. Wed, 17 Oct 2012 21:40:39 GMT

(In reply to [comment #4](#issuecomment-24244625))
> (In reply to [comment #3](#issuecomment-24244620))
> > Now that 17407 is resolved, how do the two method name-changes sound?
> 
> Given your suggestion, we'd get:
> 
> createBufferSource -> AudioBufferSourceNode
> createMediaElementSource -> MediaElementAudioSourceNode
> createMediaStreamSource -> MediaStreamAudioSourceNode
> createScriptProcessor -> ScriptProcessorNode
> createAnalyser -> AnalyserNode
> createGain -> GainNode
> createDelay -> DelayNode
> createBiquadFilter -> BiquadFilterNode
> createWaveShaper -> WaveShaperNode
> createPanner -> PannerNode
> createConvolver -> ConvolverNode
> createChannelSplitter -> ChannelSplitterNode
> createChannelMerger -> ChannelMergerNode
> createDynamicsCompressor -> DynamicsCompressorNode
> createOscillator -> OscillatorNode
> 
> This looks very intuitive to me. The only thing sticking out here are the
> three first nodes, where "Audio" is somehow in the node name (which seems
> right IMO), but not in the create* method name.
> 
> I don't have any objections to that (shorter names = good thing™), other
> than the possible loss of distinction between Audio/Video Media sources that
> you mentioned in Bug 17407. Any thoughts?

My thinking here was that the create() methods are in the "namespace" of the AudioContext, and thus it's implied that we're dealing with audio, and the clarity gained by the shorter name was worth it.  By contrast, the node/class names are in the global namespace and so I wanted to make that distinction.

---
Reply to this email directly or view it on GitHub:
https://github.com/WebAudio/web-audio-api/issues/166#issuecomment-24244627
Received on Wednesday, 11 September 2013 14:37:39 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:50:11 UTC