News for hackers. Stuff that matters.
Re:Bypassing GitHub's OAuth Flow with a Head Request by kureikain on Thursday November 07, 2019 @04:21PM (#21477409)
This is the reason I don't use else much and use explicitly matching.

`if/else` is pretty much only use for boolean with exact 2 states.

Not like this issue but the use of `if/else` can lead to thing like:

  loop do
    # do thing and increase i
    break if i == 10
  end
If i go from 9 to 11, we never exit the loop.

In language like Erlang, when you write `if/else` it force you to handle all the cases with pattern matching which I think may help reduce amount of unhandled state check error.

Re:Bypassing GitHub's OAuth Flow with a Head Request by jacquesm on Thursday November 07, 2019 @05:11PM (#21477871)
Defensive code would have you write 'break if i >= 10'.