title: Whats the concept behind a CoroutineScope?
body: <p>After reading the introduction and the javadoc of <a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html" rel="noreferrer">CoroutineScope</a> I'm still a little confused what the idea behind a <code>CoroutineScope</code> is.</p>
  
  <p>The first sentence of the doc "Defines a scope for new coroutines." is not clear to me: Why do my coroutines need a scope?</p>
  
  <p>Also, why are standalone coroutine builders deprecated? Why is it better to do this:</p>
  
  <pre><code>fun CoroutineScope.produceSquares(): ReceiveChannel&lt;Int&gt; = produce {
      for (x in 1..5) send(x * x)
  }
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>fun produceSquares(): ReceiveChannel&lt;Int&gt; = produce { //no longer an extension function
      for (x in 1..5) send(x * x)
  }
  </code></pre>