News for hackers. Stuff that matters.
Re:Our journey to type checking 4M lines of Python by tus88 on Saturday September 07, 2019 @07:41PM (#20907459)
How are you sure typing would have made a difference to that piece of Python? Are you sure there is no troublesome code written anywhere in Java or C++?
Re:Our journey to type checking 4M lines of Python by swiley on Saturday September 07, 2019 @07:46PM (#20907480)
IMO type checking is to python what bounds checking is to C.
Re:Our journey to type checking 4M lines of Python by speedplane on Sunday September 08, 2019 @06:28AM (#20909642)
> IMO type checking is to python what bounds checking is to C.

Interesting analogy, but in my experience it doesn't hold up.

If you have a Python typing bug, it will crash your program almost immediately and you can quickly catch it and fix it. In contrast, C boundary checking issues often come up in relatively rare corner cases, and when they do occur, they often do not result in an exception / error especially if the memory is already paged and set to zero.

In production code, boundary checking errors in C occur all the time, but Python type bugs are pretty rare.

Re:Our journey to type checking 4M lines of Python by justwalt on Saturday September 07, 2019 @07:49PM (#20907498)
I think he's talking specifically about the Java and C++ code that accompanied that Python file. I'm sure he's seen bad Java and C++ :)
Re:Our journey to type checking 4M lines of Python by jdm2212 on Saturday September 07, 2019 @08:01PM (#20907556)
I've seen some disgusting Java and C++, but that company had pretty high engineering standards so the Java and C++ was always good. The Python was _supposed_ to be good, too, but 20+ devs making changes to this one config generator script meant people were constantly making their own (and breaking each other's) assumptions about how the code should behave.
Re:Our journey to type checking 4M lines of Python by proverbialbunny on Sunday September 08, 2019 @12:16AM (#20908574)
At that point the first person to write good unit tests gets to specify how that part of the program is going to run. Though, really it sounds like you guys need a design pattern to address everyone's needs that everyone can agree to.

People can change unit tests. The benefit of this, is it's a kind of documentation. People can see the tests and know how it _should_ work, or they can not read them and if they create errors, they'll find out the hard way. Unit tests don't make a specification static, but they do reduce chaos.

Re:Our journey to type checking 4M lines of Python by jdm2212 on Sunday September 08, 2019 @02:12AM (#20908898)
This was a few years ago. The chaos was partly because of a lack of ownership: one team owned inputs, the other owned outputs, and there wasn't a clear spec. The whole pipeline was pretty experimental and people made up new semantics as needed, and were happy to change failing tests (or just added untested codepaths behind boolean flags in existing functions). Compile-time type checking would've enforced a greater degree of rigor about modeling what was happening and made clear all the ways existing code could be affected.