title: Remove item from linked list in a good way
body: <p>in <a href="https://www.ted.com/talks/linus_torvalds_the_mind_behind_linux/transcript" rel="nofollow noreferrer">this</a> TED talk Linus Torvalds showed "poor" and "good" programming tastes on example with removing item from linked list.</p>
  
  <p>So the poor taste example:</p>
  
  <p><a href="https://i.stack.imgur.com/pgZTo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pgZTo.png" alt="enter image description here"></a></p>
  
  <p>And here goes the good taste:</p>
  
  <p><a href="https://i.stack.imgur.com/6RUWe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6RUWe.png" alt="enter image description here"></a></p>
  
  <p>Main point here is last if statement in bad taste example.</p>
  
  <p>I am not a C/C++ developer and unfortunately for me i am thinking in "bad" taste.</p>
  
  <p>My question here: is this possible to write "smart" solution without using if statement for special case on a programming language without C-style pointers ?
  For example on java or javascript.</p>