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

> [Original comment](https://www.w3.org/Bugs/Public/show_bug.cgi?id=18332#0) by Chris Rogers on W3C Bugzilla. Tue, 02 Oct 2012 21:24:12 GMT

(In reply to comment #0)
> http://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioContext-section
> 
> The methods for creating different AudioNodes use inconsistent naming
> conventions. Here is a list of current method -> type mappings:
> 
> createBufferSource -> AudioBufferSourceNode
> createMediaElementSource -> MediaElementAudioSourceNode
> createMediaStreamSource -> MediaStreamAudioSourceNode
> createJavaScriptNode -> JavaScriptAudioNode
> createAnalyser -> RealtimeAnalyserNode
> createGainNode -> AudioGainNode
> createDelayNode -> DelayNode
> createBiquadFilter -> BiquadFilterNode
> createPanner -> AudioPannerNode
> createConvolver -> ConvolverNode
> createChannelSplitter -> AudioChannelSplitter
> createChannelMerger -> AudioChannelMerger
> createDynamicsCompressor -> DynamicsCompressorNode
> createOscillator -> Oscillator
> 
> Apart from the inconsistently named AudioNode interfaces (see Bug 17407), the
> constructors also use a fair mix of:
> 
> * Complete interface name, e.g. createDelayNode and createOscillator
> * With Node suffix, e.g. createGainNode, createDelayNode
> * Without Node suffix, e.g. createBufferSource, createConvolver
> * With key parts of the name dropped, e.g. createAnalyzer
> 
> The only consistency I can see is that any occurrences of "Audio" in the
> interface names have been dropped in the create-method names.
> 
> Suggestion: Include the entire interface name, possibly excluding Audio prefix
> and/or Node suffix (as long as it's the same for all methods).

How about being consistent by removing the "Node" suffix, leaving all the "create" methods the same, except for:

createGainNode -> createGain
createDelayNode -> createDelay

createJavaScriptNode -> createScriptProcessor

I'm less sure about the naming of "createScriptProcessor".  Some have suggested that we might use other scripting languages than JavaScript, so that shouldn't be a part of the name.

---
Reply to this email directly or view it on GitHub:
https://github.com/WebAudio/web-audio-api/issues/166#issuecomment-24244609

Received on Wednesday, 11 September 2013 14:34:20 UTC