DISQUS

DISQUS Hello! Languages of the real and artificial is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

  • Subscribe

  • Community

  • Top Commenters

  • Popular Threads

  • Recent Comments

    • NoTV service is not available in my area. Something about low demand :)

      5 months ago by Theo

      in My No TV

    • 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...

      5 months ago by eurotive

      in The Biofuel Economy

    • 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...

      5 months ago by mypc46

      in My No TV

    • Absolutely beautiful post. Thirty minutes after reading it, my whole way of doing git business has changed.

      5 months ago by Gavin

      in Commit Policies

    • Wow, this is awesome! You should talk a little more about the code behind how this works, would be a great read.

      5 months ago by fernO

      in Visualizing Regular Expressions

Jump to original thread »
Author

Three Lefts Make a Right: The Type Declaration Paradox

Started by osteele · 6 months ago

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 »

2 comments

  • Guido on static typing in Python
    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 ...
  • Colour me baffled (does that make me one of the smart people?)

    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?
Please login to comment.
Returning? Login