News for hackers. Stuff that matters.
Re:Python’s “type hints” are a bit of a disappointment to me by krageon on Friday April 22, 2022 @05:16AM (#31119640)
If you write more code that is untyped than typed, you are harming whoever comes after you. Untyped code is an absolute dragon even if it is properly documented (which it practically never is). Glorifying "productivity" and putting it above the greater good is essentially everything that's wrong with the world, at every level.
Re:Python’s “type hints” are a bit of a disappointment to me by CraigJPerry on Friday April 22, 2022 @06:01AM (#31119874)
That’s quite a strongly worded opinion. It sounds like it should be utterly trivial in this case to show that typed code causes less harm. I’m happy with whatever definition of harm you’re happy with. So where can i review the data supporting such a strongly worded position?
Re:Python’s “type hints” are a bit of a disappointment to me by oriolid on Friday April 22, 2022 @11:47AM (#31123113)
On a quick search, for example https://link.springer.com/article/10.1007/s10664-013-9289-1. "This paper describes an experiment that tests whether static type systems improve the maintainability of software systems, in terms of understanding undocumented code, fixing type errors, and fixing semantic errors. The results show rigorous empirical evidence that static types are indeed beneficial to these activities, except when fixing semantic errors." is pretty much as strongly worded as scientific journals can accept.
Re:Python’s “type hints” are a bit of a disappointment to me by CraigJPerry on Friday April 22, 2022 @04:36PM (#31127735)
Cool - this paper has 3 conclusions:

- Static type systems are an effective form of documentation

– Static type systems reduce the effort to fix type errors

– Static type systems may not be helpful in preventing semantic errors

It would have been awesome to have evidence for #3 but even just #1 & #2 could be useful, albeit to a much lesser extent. Could we quantify by how much?

It’d be important to quantify because if static types mean a developer can be done sooner, then they have spare time to spend improving the software. So do these differences with static types translate into benefits for the developer?

The author of that paper says no. He published this other paper just after that one: https://www.ics.uci.edu/~jajones/INF102-S18/readings/23_hane...

Re:Python’s “type hints” are a bit of a disappointment to me by oriolid on Saturday April 23, 2022 @01:46AM (#31131746)
For the second paper, looks like the test task is quite small and the language used requires more work from developer than a modern static type system with type inference and generics. Still the difference between static and dynamic typed variants is rather small. I wonder if the situation would change if the project took weeks or months instead of hours, but that would be an expensive experiment. Also, it would be interesting to see if type inference and generics would increase productivity but in the real world we are stuck with Java and Go anyway.

Other take home message is that the famous 10x programmer was found in both groups. The one with dynamic language was faster, just as the argument for dynamic typing goes.

Re:Python’s “type hints” are a bit of a disappointment to me by krageon on Friday April 22, 2022 @06:02AM (#31119879)
You can review it by talking to people that inherit your code, especially if they're still acclimating to it :)
Re:Python’s “type hints” are a bit of a disappointment to me by bayesian_horse on Friday April 22, 2022 @09:01AM (#31121078)
So you don't have any hard data either...
Re:Python’s “type hints” are a bit of a disappointment to me by notpachet on Friday April 22, 2022 @08:52AM (#31121002)
programming languages : diehard dynamic typing advocates :: global pandemic : mask mandate protesters
Re:Python’s “type hints” are a bit of a disappointment to me by bayesian_horse on Friday April 22, 2022 @09:12AM (#31121165)
There is no conclusive and objective evidence that static typing helps at all. Studies are at best inconclusive, certainly a far cry from confirming the superiority of static typing. Everything else is subjective. To have a recent and complete opinion about the one thing you necessarily need to have less of a recent and complete experience with another.

The benefits of masks against spreading respiratory viruses are easily and objectively proven. Completely different thing.

Re:Python’s “type hints” are a bit of a disappointment to me by notpachet on Friday April 22, 2022 @09:38AM (#31121390)
Well, while you're waiting for that study to ride down from heaven on a white horse clad in gold, the rest of us are going to just quietly get on with being (subjectively) more productive.
Re:Python’s “type hints” are a bit of a disappointment to me by _Algernon_ on Friday April 22, 2022 @04:59PM (#31128048)