title: Why does the expert change MutableList to List?
body: <p>I asked a question at <a href="https://stackoverflow.com/questions/47586213/how-to-design-a-complex-class-which-incude-some-classes-to-make-expansion-easily">How to design a complex class which incude some classes to make expansion easily in future in Kotlin?</a> about how to design a complex class which incude some classes to make expansion easily in future in Kotlin.</p>
  
  <p>A expert named s1m0nw1 give me a great answer as the following code.</p>
  
  <p>But I don't know why he want to change <code>MutableList</code> to <code>List</code> at <a href="https://stackoverflow.com/posts/47960036/revisions">https://stackoverflow.com/posts/47960036/revisions</a> , I can get the correct result when I use MutableList. Could you tell me?</p>
  
  <p><strong>The code</strong></p>
  
  <pre><code>interface DeviceDef
  data class BluetoothDef(val Status: Boolean = false) : DeviceDef
  data class WiFiDef(val Name: String, val Status: Boolean = false) : DeviceDef
  data class ScreenDef(val Name: String, val size: Long) : DeviceDef 
  
  
  class MDetail(val _id: Long, val devices: List&lt;DeviceDef&gt;) {
  
      inline fun &lt;reified T&gt; getDevice(): T {
          return devices.filterIsInstance(T::class.java).first()
      }
  }
  </code></pre>
  
  <p><strong>Added</strong> </p>
  
  <p>I think that <code>mutableListOf&lt;DeviceDef&gt;</code> is better than <code>ListOf&lt;DeviceDef&gt;</code> in order to extend in future.</p>
  
  <p>I can use <code>aMutableList.add()</code> function to extend  when I append new element of  <code>mutableListOf&lt;DeviceDef&gt;</code>.</p>
  
  <p>If I use <code>ListOf&lt;DeviceDef&gt;</code>, I have to construct it with <code>listOf(mBluetoothDef1, mWiFiDef1, //mOther)</code>, it's not good. Right?</p>
  
  <pre><code>var aMutableList= mutableListOf&lt;DeviceDef&gt;()
  
  var mBluetoothDef1= BluetoothDef(true)
  var mWiFiDef1= WiFiHelper(this).getWiFiDefFromSystem()
  
  aMutableList.add(mBluetoothDef1)
  aMutableList.add(mWiFiDef1)
  
  // aMutableList.add(mOther)  //This is extension
  
  var aMDetail1= MDetail(myID, aMutableList)
  </code></pre>