<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18332</bug_id>
          
          <creation_ts>2012-07-19 13:40:33 +0000</creation_ts>
          <short_desc>Node creation method naming inconsistencies</short_desc>
          <delta_ts>2013-04-25 15:31:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>AudioWG</product>
          <component>Web Audio API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>TBD</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marcus Geelnard (Opera)">mage</reporter>
          <assigned_to name="Chris Rogers">crogers</assigned_to>
          <cc>olivier.thereaux</cc>
          
          <qa_contact>public-audio</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71152</commentid>
    <comment_count>0</comment_count>
    <who name="Marcus Geelnard (Opera)">mage</who>
    <bug_when>2012-07-19 13:40:33 +0000</bug_when>
    <thetext>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 -&gt; type mappings:

createBufferSource -&gt; AudioBufferSourceNode
createMediaElementSource -&gt; MediaElementAudioSourceNode
createMediaStreamSource -&gt; MediaStreamAudioSourceNode
createJavaScriptNode -&gt; JavaScriptAudioNode
createAnalyser -&gt; RealtimeAnalyserNode
createGainNode -&gt; AudioGainNode
createDelayNode -&gt; DelayNode
createBiquadFilter -&gt; BiquadFilterNode
createPanner -&gt; AudioPannerNode
createConvolver -&gt; ConvolverNode
createChannelSplitter -&gt; AudioChannelSplitter
createChannelMerger -&gt; AudioChannelMerger
createDynamicsCompressor -&gt; DynamicsCompressorNode
createOscillator -&gt; 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 &quot;Audio&quot; 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&apos;s the same for all methods).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75116</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-10-02 21:24:12 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; http://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioContext-section
&gt; 
&gt; The methods for creating different AudioNodes use inconsistent naming
&gt; conventions. Here is a list of current method -&gt; type mappings:
&gt; 
&gt; createBufferSource -&gt; AudioBufferSourceNode
&gt; createMediaElementSource -&gt; MediaElementAudioSourceNode
&gt; createMediaStreamSource -&gt; MediaStreamAudioSourceNode
&gt; createJavaScriptNode -&gt; JavaScriptAudioNode
&gt; createAnalyser -&gt; RealtimeAnalyserNode
&gt; createGainNode -&gt; AudioGainNode
&gt; createDelayNode -&gt; DelayNode
&gt; createBiquadFilter -&gt; BiquadFilterNode
&gt; createPanner -&gt; AudioPannerNode
&gt; createConvolver -&gt; ConvolverNode
&gt; createChannelSplitter -&gt; AudioChannelSplitter
&gt; createChannelMerger -&gt; AudioChannelMerger
&gt; createDynamicsCompressor -&gt; DynamicsCompressorNode
&gt; createOscillator -&gt; Oscillator
&gt; 
&gt; Apart from the inconsistently named AudioNode interfaces (see Bug 17407), the
&gt; constructors also use a fair mix of:
&gt; 
&gt; * Complete interface name, e.g. createDelayNode and createOscillator
&gt; * With Node suffix, e.g. createGainNode, createDelayNode
&gt; * Without Node suffix, e.g. createBufferSource, createConvolver
&gt; * With key parts of the name dropped, e.g. createAnalyzer
&gt; 
&gt; The only consistency I can see is that any occurrences of &quot;Audio&quot; in the
&gt; interface names have been dropped in the create-method names.
&gt; 
&gt; Suggestion: Include the entire interface name, possibly excluding Audio prefix
&gt; and/or Node suffix (as long as it&apos;s the same for all methods).

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

createGainNode -&gt; createGain
createDelayNode -&gt; createDelay

createJavaScriptNode -&gt; createScriptProcessor

I&apos;m less sure about the naming of &quot;createScriptProcessor&quot;.  Some have suggested that we might use other scripting languages than JavaScript, so that shouldn&apos;t be a part of the name.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75197</commentid>
    <comment_count>2</comment_count>
    <who name="Marcus Geelnard (Opera)">mage</who>
    <bug_when>2012-10-03 07:07:26 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; How about being consistent by removing the &quot;Node&quot; suffix, leaving all the
&gt; &quot;create&quot; methods the same, except for:
&gt; 
&gt; createGainNode -&gt; createGain
&gt; createDelayNode -&gt; createDelay
&gt; 
&gt; createJavaScriptNode -&gt; createScriptProcessor
&gt; 
&gt; I&apos;m less sure about the naming of &quot;createScriptProcessor&quot;.  Some have suggested
&gt; that we might use other scripting languages than JavaScript, so that shouldn&apos;t
&gt; be a part of the name.

I think we need to resolve Bug 17407 before moving forward with this one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76437</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-10-16 20:11:05 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; How about being consistent by removing the &quot;Node&quot; suffix, leaving all the
&gt; &gt; &quot;create&quot; methods the same, except for:
&gt; &gt; 
&gt; &gt; createGainNode -&gt; createGain
&gt; &gt; createDelayNode -&gt; createDelay
&gt; &gt; 
&gt; &gt; createJavaScriptNode -&gt; createScriptProcessor
&gt; &gt; 
&gt; &gt; I&apos;m less sure about the naming of &quot;createScriptProcessor&quot;.  Some have suggested
&gt; &gt; that we might use other scripting languages than JavaScript, so that shouldn&apos;t
&gt; &gt; be a part of the name.
&gt; 
&gt; I think we need to resolve Bug 17407 before moving forward with this one.

Now that 17407 is resolved, how do the two method name-changes sound?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76471</commentid>
    <comment_count>4</comment_count>
    <who name="Marcus Geelnard (Opera)">mage</who>
    <bug_when>2012-10-17 07:13:38 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Now that 17407 is resolved, how do the two method name-changes sound?

Given your suggestion, we&apos;d get:

createBufferSource -&gt; AudioBufferSourceNode
createMediaElementSource -&gt; MediaElementAudioSourceNode
createMediaStreamSource -&gt; MediaStreamAudioSourceNode
createScriptProcessor -&gt; ScriptProcessorNode
createAnalyser -&gt; AnalyserNode
createGain -&gt; GainNode
createDelay -&gt; DelayNode
createBiquadFilter -&gt; BiquadFilterNode
createWaveShaper -&gt; WaveShaperNode
createPanner -&gt; PannerNode
createConvolver -&gt; ConvolverNode
createChannelSplitter -&gt; ChannelSplitterNode
createChannelMerger -&gt; ChannelMergerNode
createDynamicsCompressor -&gt; DynamicsCompressorNode
createOscillator -&gt; OscillatorNode

This looks very intuitive to me. The only thing sticking out here are the three first nodes, where &quot;Audio&quot; is somehow in the node name (which seems right IMO), but not in the create* method name.

I don&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76525</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-10-17 21:40:39 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; Now that 17407 is resolved, how do the two method name-changes sound?
&gt; 
&gt; Given your suggestion, we&apos;d get:
&gt; 
&gt; createBufferSource -&gt; AudioBufferSourceNode
&gt; createMediaElementSource -&gt; MediaElementAudioSourceNode
&gt; createMediaStreamSource -&gt; MediaStreamAudioSourceNode
&gt; createScriptProcessor -&gt; ScriptProcessorNode
&gt; createAnalyser -&gt; AnalyserNode
&gt; createGain -&gt; GainNode
&gt; createDelay -&gt; DelayNode
&gt; createBiquadFilter -&gt; BiquadFilterNode
&gt; createWaveShaper -&gt; WaveShaperNode
&gt; createPanner -&gt; PannerNode
&gt; createConvolver -&gt; ConvolverNode
&gt; createChannelSplitter -&gt; ChannelSplitterNode
&gt; createChannelMerger -&gt; ChannelMergerNode
&gt; createDynamicsCompressor -&gt; DynamicsCompressorNode
&gt; createOscillator -&gt; OscillatorNode
&gt; 
&gt; This looks very intuitive to me. The only thing sticking out here are the
&gt; three first nodes, where &quot;Audio&quot; is somehow in the node name (which seems
&gt; right IMO), but not in the create* method name.
&gt; 
&gt; I don&apos;t have any objections to that (shorter names = good thing™), other
&gt; than the possible loss of distinction between Audio/Video Media sources that
&gt; you mentioned in Bug 17407. Any thoughts?

My thinking here was that the create() methods are in the &quot;namespace&quot; of the AudioContext, and thus it&apos;s implied that we&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76563</commentid>
    <comment_count>6</comment_count>
    <who name="Marcus Geelnard (Opera)">mage</who>
    <bug_when>2012-10-18 07:50:45 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; My thinking here was that the create() methods are in the &quot;namespace&quot; of the
&gt; AudioContext, and thus it&apos;s implied that we&apos;re dealing with audio, and the
&gt; clarity gained by the shorter name was worth it.  By contrast, the
&gt; node/class names are in the global namespace and so I wanted to make that
&gt; distinction.

Ah, good point. Looks fine to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78323</commentid>
    <comment_count>7</comment_count>
    <who name="Chris Rogers">crogers</who>
    <bug_when>2012-11-14 21:32:36 +0000</bug_when>
    <thetext>Fixed:
https://dvcs.w3.org/hg/audio/rev/233781dbb864</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78338</commentid>
    <comment_count>8</comment_count>
    <who name="Marcus Geelnard (Opera)">mage</who>
    <bug_when>2012-11-15 08:10:45 +0000</bug_when>
    <thetext>Looks good. A minor miss though: createGainNode is still being used in an example (1.2. Modular Routing).

By the way, should appendix C (Web Audio API Change Log) still be maintained or should it be dropped? It seems to lack most recent updates.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78474</commentid>
    <comment_count>9</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2012-11-19 16:08:30 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; By the way, should appendix C (Web Audio API Change Log) still be maintained
&gt; or should it be dropped? It seems to lack most recent updates.

I gather it&apos;s updated only when we do a /TR publication. The up-to-date changelog remains http://dvcs.w3.org/hg/audio/ (which, admittedly, also includes the change log for our other docs)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79821</commentid>
    <comment_count>10</comment_count>
    <who name="Marcus Geelnard (Opera)">mage</who>
    <bug_when>2012-12-10 11:33:00 +0000</bug_when>
    <thetext>Setting to reopened, since section 1.2. is still wrong (see https://www.w3.org/Bugs/Public/show_bug.cgi?id=18332#c8 ).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85563</commentid>
    <comment_count>11</comment_count>
    <who name="Olivier Thereaux">olivier.thereaux</who>
    <bug_when>2013-04-04 14:37:36 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; Looks good. A minor miss though: createGainNode is still being used in an
&gt; example (1.2. Modular Routing).

I have spun off Bug #21580 to track this particular issue. 

Closing here.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>