News for hackers. Stuff that matters.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by fragmede on Friday January 07, 2022 @01:22PM (#29842689)
Keywords like namespace, no; but functions and classes and modules provide for a lot of scoping opportunities.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by ReleaseCandidat on Friday January 07, 2022 @01:26PM (#29842755)
The problem is `fop` should be `foo`:

    foo = 5
    fop = 6
Keywords like `let` solve this problem:

   let foo = 5
   fop = 6 # error
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by deathanatos on Friday January 07, 2022 @01:44PM (#29843002)
Not entirely:

  let foo = a();
  let foo = b(foo);
  let fop = c(foo);
  let foo = d(foo);
(Which is valid, e.g., in Rust.)
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by renox on Saturday January 08, 2022 @09:03AM (#29851766)
I hate variables shadowing, I'm very surprised that they allowed it in Rust, I saw an unpected behaviour caused by variable shadowing in C++ (global variable hidden by member variable) just last week..
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by TheEzEzz on Friday January 07, 2022 @02:43PM (#29843740)
You do get a warning, though. And most Rust projects I've seen usually adhere to 0 warnings.
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by Too on Saturday January 08, 2022 @03:14AM (#29849732)
A good IDE has many other safety nets for that error.

Auto completion, highlight matching variable, gray out unread variables and warning of unused assignment.

I’ve written lots of python and can’t recall ever having this issue. More likely is a logic typo of two similar variables like length_x vs length_y, where a “let” wouldn’t have saved you anyway if both are already defined.

JavaScript, pre strict TS, on the other hand, where missing var implied global was a real motherload of bugs. Or kotlins “val” vs “var” changing semantics completely…wow. But those are different concepts from basic definition I know.

Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by ErikCorry on Friday January 07, 2022 @01:31PM (#29842825)
Or := for declaration like Go and Toit
Re:5% of 666 Python repos had comma typo bugs (inc V8, Tenso... by ReleaseCandidat on Friday January 07, 2022 @02:20PM (#29843500)
Yes, or another symbol instead of `=` for assignment, like `<-` (F#)