Tigraine

Daniel Hoelbling-Inzko talks about programming

.NET Framework Library Source Code released

Wow! Scott Guthrie just announced on his blog that the source servers are ready and that they just released most of their .NET source code to the public.

This means that you are able to download the debug symbols and actually debug the .NET classes if you want to. Or you can just drool over the framework and try to learn a thing or two.

Go check out Shawn Burke's blog post about how to set things up.

Filed under net, net, net-35, microsoft

C# Talk

Now and then I delve through some Java tutorials or Java applications for my studies. And everytime I do so I immediately lack the getter/setter language features of C#.

To make myself clear (to non-C# Developers). Java has either Public or Private properties, but no way to add validation Logic etc to those. It is usually considered bad coding technique to expose instance variables outside of the class so almost everything has to be accessed through functions. So to expose a integer variable called State you would have to create something similar to this:

get_set_Java 

It works and once you're used to it you will create setter/getter methods in your sleep. But, when pulling up your IntelliSense (ok, you don't have that in Java, but you know what I mean) on that class you will be somewhat overwhelmed by get/set functions :).

So, how did C# handle this? They borrowed a bit from Delphi and C# and created properties with get/set blocks (nothing new). So our code from above would look like:

get_set_C

The great thing: Intellisense gets easier, you have something clearly marked as property not as function (that's used to access a property). Usability for your API has just increased :).

But, despite the awesomeness of this function (already in the .NET Framework since 1.0) in .NET 3.5 they managed to improve this feature a bit. How? Imagine all those cases where you don't have any validator logic on your properties, you just want a simple public field in your class. In older Frameworks you'd have to create get/set Blocks for this Field although you don't want any logic there (exposing Instance-Variables is stupid no matter how you do it).

So, 3.5 Introduced this:

get_set_35

Great, we came down to 1 line of code, and what happened? .NET creates the private instance-variable automatically and handles the simple get/set stuff for us. When we decide we need validation or something in the get/set blocks we can just come back and expand those blocks without having to change any code outside the class (it was a get/set property all the time)

Visual Studio 2008 und .NET 3.5 Release!

Tadaaa.. Es ist da..

Nach einigem Warten ist es endlich soweit..

Scott Guthrie verkündet, dass VS2008 und .NET 3.5 endlich released wurden!

My Photography business

Projects

dynamic css for .NET

Archives

more