Page Summary
Active Entries
- 1: Interesting Links for 12-04-2026
- 2: Photo cross-post
- 3: Interesting Links for 10-04-2026
- 4: Interesting Links for 08-04-2026
- 5: Interesting Links for 09-04-2026
- 6: Photo cross-post
- 7: Life with two kids: magic numbers
- 8: Interesting Links for 31-03-2026
- 9: What books did Terry Pratchett find inspirational?
- 10: Interesting Links for 03-04-2026
Style Credit
- Style: Neutral Good for Practicality by
Expand Cut Tags
No cut tags
no subject
Date: 2009-11-11 12:13 pm (UTC)Personally, I am not sure whether it would be great or a hassle. I am awfully fond of strong typing - but immensely irritated at times by what seem unnecessary casts...
Does 4.0 do it?
no subject
Date: 2009-11-11 12:26 pm (UTC)Let's say you have an interface IClickable that specifies a void Click() method and a class Button with a void Click() method on it, then there's no reason why a smart compiler couldn't accept that Button can be passed as an IClickable even if its declaration doesn't mention that it implements that interface.
It'd be a bit slower than just checking the list of implemented interfaces, but it could still be done.
4.0 allows you to do it weakly - using dynamic - which uses reflection to make the call under the covers. But you lose your static typing that way.
no subject
Date: 2009-11-11 12:30 pm (UTC)Should make mock types a lot easier to use.