I know that every single person in my multi million user base is interested in LINQ. To your great satisfaction here are two pieces of somewhat strange LINQ behavior that you are (undoubtedly) going to enjoy. The two pieces are completely unrelated. The first requires a little knowledge about LINQ to SQL and ADO.NET and the second requires good familiarity with the C# language (reading AND understanding the "What Is New in C# 3.0" series will do as well).
Class Library project coming to Visual Web Developer Express
just posted on his blog about the new features that Service Pack 1 for Visual Studio 2008 will bring to Visual Web Developer Express Edition. ASP.NET MVC will be supported on VWD Express but what I find more exciting is the ability to create class libraries(.dll) projects in VWD. I have always seen that as the biggest drawback of the Express Edition. I hope VWD will be able to open solutions that contain class library projects created in higher editions of Visual Studio. Right now it loads only the web projects. You can read the original post here
Update: Scott just confirmed in the comments on his blog that VWD Express will open solutions containing class libraries created in other editions of Visual Studio. I guess that makes VWD Express full featured IDE as long as you are a lone developer.
Programming for Perverts
Today I was looking at a Sun Certified Java Programmer example test (quite an old one - url no longer valid). There were some quite curious questions. I have taken out and modified questions that apply to C# (unless otherwise noted) and left out Java specific ones. Try to guess the compilation result/output! Here they are in C# version:
int i = 1;
i <<= 31;
i >>= 31;
Console.WriteLine(Double.NaN == Double.NaN);
double zero = 0;
Console.WriteLine(Double.NaN == 3 / zero);
int i = 10;
int j = 10;
bool b = false;
if (b = 10 == 10)
4. This one behaves differently in Java and C#
System.out.println(-0.0 == +0.0);
System.out.println(Math.min(-0.0,+0.0) == Math.max(0.0,+0.0));
Console.WriteLine(-0.0 == +0.0);
Console.WriteLine(Math.Min(-0.0, +0.0) == Math.Max(0.0, +0.0));
int i = 0;
Console.WriteLine(i++ + ++i);
Console.WriteLine(i++ + i++);
Console.WriteLine(Double.PositiveInfinity + Double.NegativeInfinity);
Console.WriteLine(Double.PositiveInfinity == Double.PositiveInfinity);
Check the full article for the actual output!
.NET and SQL Server Adventures
While preparing the last set of upgrades for the no-blog I stumbled upon some strange issues with different technologies. I reasoned that I might help some of you or some poor googling soul by posting about them here...
What Is New in C# 3.0 - Part 8 (LINQ to SQL)
This is the end, beautiful friend, the end. The end of (your) laughter and (my) soft lies. The end of nights we tried to code. The final part of the series. Because this is a series about the new things in the LANGUAGE C# 3.0 and not in Visual Studio 2008 or .NET Framework 3.5 it will end here. Actually this article is also out of scope but it is needed to better demonstrate how the features work in practice.