News for hackers. Stuff that matters.
Re:Google broke a conditional statement that verifies passwo... by sneak on Thursday July 22, 2021 @04:23PM (#27923835)
If you consider a linter part of a programming language, most, when properly configured, do not permit this. It's just the syntax that does; professionals do not rely on syntax validity alone but employ linting, code review, static analysis, and integrations tests on top.

The gradient of professionalism in our industry is very wide, and the slope is quite shallow.

To your point, however, many languages (such as Go, developed and used by Google, the organization under discussion) have designed their syntax now to completely avoid this type of error even being possible.

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.
Re:Google broke a conditional statement that verifies passwo... by galangalalgol on Thursday July 22, 2021 @04:41PM (#27924044)
what is the difference between linting and static analysis? Coverity, cppcheck etc, what are those? You mention integration tests, but not unit test, do you value unit test?
Re:Google broke a conditional statement that verifies passwo... by Macha on Thursday July 22, 2021 @08:49PM (#27926105)
You could consider linting a subset of static analysis that considers only smaller units of code and not program flow. A linter might tell you your variable names are wrong or your brackets are wrong or you used discouraged method xyz. A different static analysis tool might tell you there's a path through a function that leaks memory.