I'm Going Functional
You may have noticed that I did not post any programming related articles lately. The main reason for this is that after I played with C# 3.0 and LINQ I have not learned anything really interesting. That is why I am beginning to study F#
. To quote the "Expert F#" book review:
"Expert F# is about practical programming in a beautiful language that puts the power and elegance of functional programming into the hands of .NET developers."
Why learning F#?
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...