title: What is the difference between require and assert?
body: <p>With <a href="https://kotlinlang.org/docs/reference/whatsnew13.html" rel="noreferrer">Kotlin 1.3</a> came a new feature, contracts, and with them the function <code>require()</code>, but it seems pretty similar to <code>assert()</code>. Here is what their KDoc says:  </p>
  
  <p><code>require(value: Boolean)</code>: Throws an <code>IllegalArgumentException</code> if the <code>value</code> is false.</p>
  
  <p><code>assert(value: Boolean)</code>: Throws an <code>AssertionError</code> if the <code>value</code> is false and runtime assertions have been enabled on the JVM using the -ea JVM option.</p>
  
  <p>So when should I use <code>require()</code> and when should I use <code>assert()</code>?</p>