title: Alternative way to write conditional statement
body: <p>Here I have a sample of code.</p>
  
  <p>I would like to know other way to write this code; specially I would like to know other forms for the nested <code>if</code>.</p>
  
  <p>Also I would like your opinion about commenting (what are the best practice, is my style of commenting sufficient in professional environment?)</p>
  
  <p>If this question is out of scope for SO please let me know, I will remove it please do not down vote I just try to learn about programming ;-).</p>
  
  <pre><code>// Has User expressed his preference?
  if (!repositoryDevice.HasDevicePreference(userDevice))   // If not ...
  {
      // Save the preference
      repositoryPreference.Add(userDevice.UserId, candidateId);
      result = true;
  }
  else   // If yes ... 
  {
      // If a User has express his preference more than 1 hour ago
      // allow the User to change his preference, otherwise not
      if (!HasUserRecentPreference(userDevice))
      {
          repositoryPreference.Add(userDevice.UserId, candidateId);
          result = true;
      }
  }
  </code></pre>