title: What is the boolean result of assign null to a variable
body: <p>I almost sure those two codes are equivalent, but not sure why.</p>
  
  <p>First is the how I usually do it, i think the safe and more readable way.</p>
  
  <pre><code>string userLine = Console.ReadLine();
  
  while (userLine != null) {
      // do things with userLine
      userLine =  Console.ReadLine();
  }
  </code></pre>
  
  <p>Second one works but not sure why. Because Im comparing an assigment to null.</p>
  
  <pre><code>string userLine;
  
  while ((userLine =  Console.ReadLine()) != null) {
      // do things with userLine
  }
  </code></pre>