Community Page
- osteele.com Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- NoTV service is not available in my area. Something about low demand :)
- I also read recently about Ethanol polluting more than gasoline. Not sure if its true coz I couldn’t keep up with all of the chemistry..but im very much interested with fuels becoz im a car...
- We got NOtv when we lost cross country wireless and moved to a new house. We found that DSL was a better item and we can actually limit what we see. The NOtv has been a shock to many folks who are...
- Absolutely beautiful post. Thirty minutes after reading it, my whole way of doing git business has changed.
- Wow, this is awesome! You should talk a little more about the code behind how this works, would be a great read.
Jump to original thread »
A few days ago "I argued":http://osteele.com/archives/2004/12/type-declaration-compromise that even though type declarations aren't the best possible solution for any _particular_ problem, they can be the right solution for solving _several problems at once_. I baffled even
... Continue reading »
4 years ago
I was just reading the latest brain dump by Guido on 'Optional Static Typing in Python' and various comments on it.
First impression? I don't like it. The simple reason being that it makes Python much more complex. I know its the same rant again ...
3 years ago
Of the approaches you present exactly one will definitely prevent the function body being executedwith ill-typed arguments by any client code: assertions.
Variable names, comments and structured comments will not provent client code asking for gcd(-7.62, 2+i), but they will prompt any human who's read the declaration of gcd to not casually write code that would do that, which seems like a win. This is the way programmers in languages with dynamic typing get used to thinking.
Of your proposed aproaches exactly one tells the human programmer and the client code a direct lie about gcd(): type declaration. It does not merely "[lose] the information that a and b are non-negative", it asserts the untruth that they can be negative. How is this any sort of benefit?