News for hackers. Stuff that matters.
Re:Google broke a conditional statement that verifies passwo... by tmp_anon_22 on Thursday July 22, 2021 @04:33PM (#27923943)
> type of error even being possible

I mean its still possible to forget the ":" character and its still possible to mentally scan a PR and see "=" and miss that it should have been a "==".

Re:Google broke a conditional statement that verifies passwo... by edflsafoiewq on Thursday July 22, 2021 @04:45PM (#27924080)
= vs == isn't possible in Go because of the statement/expression distinction. The benefits of allowing assignment to be an expression are too small compared to the problems it causes.

  x == 1 // oops, meant =
  // x == 1 evaluated but not used

  if x = 1 { ... } // oops, meant ==
  // syntax error: assignment x = 1 used as value
Re:Google broke a conditional statement that verifies passwo... by Macha on Thursday July 22, 2021 @08:43PM (#27926074)
Python had similar, then introduced := for explicit assignment-as-expression. The debate over that one is considered a contributing factor to Guido's retirement as bdfl
Re:Google broke a conditional statement that verifies passwo... by tmp_anon_22 on Thursday July 22, 2021 @07:21PM (#27925502)
Ah I see your point. Appreciate the correction.