First time here? Check out the site's "greatest hits" or read a post from the archives. Feel free to leave a comment or ask a question, and consider subscribing to the latest posts via RSS or e-mail. Thanks for visiting!
« Three Monitors - I can't go back | Main | Installing iTunes 7 on 64-bit Windows Vi... »

In my new ongoing quest to read source code to be a better developer, I now present the first in an infinite number of a weekly series called "The Weekly Source Code." Here's some source I'm reading this week that I enjoyed.

Feel free to send me links to cool source that you find hasn't been given a good read.



Thursday, August 16, 2007 9:24:19 PM (Pacific Standard Time, UTC-08:00)
It would be cool if someone created an RSS feed containing byte-sized snippets of beautiful code.

Anyway, here's my contribution:

RSS feed of the Firebug source code:
http://feedchopper.ning.com/index.php/main/feed/showUrl?id=3299679

RSS feed of the Haskell Prelude:
http://feedchopper.ning.com/index.php/main/feed/showUrl?id=6633928
Tuesday, August 21, 2007 2:35:04 PM (Pacific Standard Time, UTC-08:00)
The Duck Typing project is pretty interesting, but doesn't have much to do with the Var type of situation. What he's doing is a very clever bit of reflection.

He's dynamically creating a type at runtime that wraps the original type using reflection. It basically dynamically creates a proxy to the target type. So, for example, you could DuckType a control of type DropDownList as a control of type RadioButtonList as long as you access properties that are of the same type. So, you could do something like the following:

RadioButtonList rblDuck = DuckTyping.Cast<RadioButtonList>(myDropDownList);
rbl.SelectedValue = "Example";

Both RadioButtonLists and DropDownLists have "SelectedValue" in common, so the RadioButtonList "ducktype" acts as a proxy to the actual underlying DropDownList, forwarding the values on to myDropDownList. Neat stuff.

This is all at runtime, though. Var is different because it is a type that is determined at compile time. It's possible that Microsoft's DLR strategy is similar, but I'm not sure about that yet.
Wednesday, September 19, 2007 4:34:04 AM (Pacific Standard Time, UTC-08:00)
test bugaga
Wednesday, September 19, 2007 5:35:17 AM (Pacific Standard Time, UTC-08:00)
test bugaga
Comments are closed.

Contact

Sponsors

Hosting By

On this page...

Tags

Calendar

<November 2008>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

Archives

Google Ads