Bin gerade von meinem Vortrag bei der Usergroup bonn-to-code zurück. Und da sofort schneller geht als irgendwann, habe ich direkt mal die Slides gepostet.
Posts Tagged ‘c#’
Alles Vertragssache: Ko- und Kontravarianz in C#
Posted in Deutsch, Talks & Presentations, dotnet, tagged c#, variance on November 24, 2009 | 1 Comment »
24. November 2009: Ko- und Kontravarianz bei Bonn-to-Code
Posted in Deutsch, Talks & Presentations, tagged c#, community, german, presentation on November 21, 2009 | 1 Comment »
Beim nächsten Bonn-to-Code-Usergroup-Treffen halte ich einen Kurzvortrag zu Ko- und Kontravarianz in C#.
Sneak Peak
Eines der meistbegrüßten Features aus .NET 4 und gleichzeitig eines der am wenigsten verstandenen. Leicht dahergesagt, dass Argumente von Methoden und Delegates schon immer kontravariant waren. Und dass in C# 4.0 jetzt noch sichere Ko- und Kontravarianz für generische Typparameter hinzukommt. Und [...]
Test helpers #1: Repetition Extensions and Scenario
Posted in dotnet, tagged c#, extension methods, test on March 13, 2009 | 3 Comments »
While writing tons of tests I would like to share some of my helper classes here. My first ones are for doing simple performance measurements (not too accurate) and repeating actions.
Code:
using (new Scenario("Sum of all squares from 1 to 100"))
Console.WriteLine("Sum is: {0}", 100.Times(x => x * x).Sum());
using (new Scenario("Print all squares [...]
Behind the scenes of the C# yield keyword
Posted in dotnet, tagged c#, compiler, compilergenerated, yield, yield statement on June 9, 2008 | 12 Comments »
After reading the great article about the code-saving yield keyword “Give way to the yield keyword” by Shay Friedman I thought it could be interesting to know how the yield keyword works behind the scenes.
…it doesn’t really end the method’s execution. yield return pauses the method execution and the next time you call it (for [...]
Use Path.Combine to avoid ugly program failures!
Posted in dotnet, tagged c#, Configuration on May 28, 2008 | 3 Comments »
I’ve so often seen people combining paths like this:
string path = basePath + "\\" + filename;
Sometimes they use Path.DirectorySeparatorChar or even check wether basePath or filename already contains. The program then fails with exceptions like "could not find file c:\Program Files\MyProggie\\settings.xml" or even worse files like MyProggiesettings.xml are created, just because the person configuring the [...]
Free .Net Ambient Context Pattern Implementation
Posted in dotnet, tagged Ambient Context Pattern, c#, ThreadLocal, ThreadSafe on April 24, 2008 | 13 Comments »
For Geeks: Skip explanations, just show the solution!
Well, many of us already utilize this pattern – just without knowing it has a name. I found this name somewhere, and I like it.
On http://aabs.wordpress.com the Intend is defined like this:
Intent: Provide a place to store scope or context related information or functionality that automatically follows the flow [...]
Using the using-statement
Posted in dotnet, tagged c# on April 10, 2008 | 9 Comments »
“Using statement?”, you may ask. “What is so interesting about that? I use it every day importing tons of namespaces!”
Well, i mean the other using statement; that one that results in a nice try..finally in IL, without having to write lots of code.
Well lets say you want to access a file, a database, or whatever [...]