Talk:Evaluate binomial coefficients: Difference between revisions

Content added Content deleted
Line 165: Line 165:


: My personal verdict is that in languages like Idris, Agda, Haskell, where the compiler does use the type signatures, they are excellent and indispensable, but that in Python3, which doesn't yet use them, they are (at the scale of Rosetta Code examples) a nice idea, but no more in practice than a source of additional bugs, and, if used in place of type comments, just make things less clear and more difficult for the reader.
: My personal verdict is that in languages like Idris, Agda, Haskell, where the compiler does use the type signatures, they are excellent and indispensable, but that in Python3, which doesn't yet use them, they are (at the scale of Rosetta Code examples) a nice idea, but no more in practice than a source of additional bugs, and, if used in place of type comments, just make things less clear and more difficult for the reader.
: Even Donald was clearly confused by them, assigning wrong types, and inadvertently introducing in what he presumably hoped to be an 'improvement', both compiler and mypy errors ...
: Even Donald was clearly confused by them, assigning wrong types, and introducing (in what he presumably envisioned as an 'improvement'), both compiler and mypy errors ...
: On the scale of much larger projects, and as a complement to comments, rather than a substitute for them, the use of the '''mypy''' and the type hints which it can read, will doubtless begin to pay off the cost of the expanded bug surface which it initially introduces.
: On the scale of much larger projects, and as a complement to comments, rather than a substitute for them, the use of the '''mypy''' and the type hints which it can read, will doubtless begin to pay off the cost of the expanded bug surface which it initially introduces.


: For the small scale of Rosetta Code examples however - nice idea, but perhaps doesn't yet survive experiment, or actually benefit RC readers ? Maybe when Python4 comes ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 08:55, 24 February 2019 (UTC)
: For the small scale of Rosetta Code examples however - nice idea, but perhaps doesn't yet survive experiment, or actually benefit RC readers ? Maybe when Python4 comes ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 08:55, 24 February 2019 (UTC)


:: Donald [[User:Paddy3118|Paddy3118]]. Do feel free to introduce type hints into your own code - but please desist from deleting my type comments and replacing them with these hints. They damage the legibility of the code, demonstrably expand the surface for bugs, and in Python3, offer no benefit whatsoever to the compiler.
:: Donald [[User:Paddy3118|Paddy3118]]. Do feel free to introduce type hints into your own code - but please desist from deleting my type comments and replacing them with these hints. They damage the legibility of the code, demonstrably enlarge the surface for bugs, and in Python3, offer no benefit whatsoever to the compiler.
:: Not easy to think of a better example of the 'foolish consistency' against which PEP8 prominently warns on its opening page. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 09:02, 24 February 2019 (UTC)
:: Not easy to think of a better example of the 'foolish consistency' against which PEP8 prominently warns on its opening page. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 09:02, 24 February 2019 (UTC)