
April 20, 2004
Every parent watches their child grow, and the first few months are almost
always filled with month after month of changes, developments and "firsts".
First smile, first words, first crawl, and so on. And, of course, first pictures,
to be shown off in annoying regularity with just about any other grown or half-grown
adult on the planet that has the unfortunate luck to cross paths with the new
parent.
By the way, did I show you those photos of my kids....?
Last week (April 13th) marked the three-month anniversary of the day TheServerSide.NET
opened its doors to the public, as it were. While it doesn't mean much in the
grand scheme of things, compared, for example, to the four years of TheServerSide.com
or the (roughly) ten years since the first public perception of the Internet
via the release of the Netscape browser, still, its an anniversary, and every
proud parent always takes every chance to talk about their baby and just how
much he (or she) has grown up.
In the last three months, TheServerSide.NET has grown--perhaps not appreciably
from the outside, but as we track statistics here it's pretty obvious to see.
February marked close to a million page views. April will likely see much the
same, if current statistical trends hold.
We've started to see the community grow around the forums and news discussions.
We've had a few fits and starts, as any newborn does, trying to get a feel for
our surroundings and get our legs out from underneath us. We've had a few bumps
along the way--yours truly included--but overall the growth has been positive
and beneficial to the community as a whole.
But page views and statistics only tell a part of the story.
Last week, I was in Redmond attending the Microsoft MVP Summit, having been
invited to join back in January. It was three and a half days of partying with
and listening to the various development leads and architects of Microsoft's
next generation software as they sought feedback on the alphas and betas that
had been released thus far. As a C# MVP (since there are no CLR MVPs as of yet),
I attended to pursue a two-pronged agenda:
1) Hear what nifty new things had been introduced since the last time I'd heard
Microsoft folk speak on the subject (that being PDC in October), and
2) Talk to MVPs and Microsoft folk like about TheServerSide.NET, and look to
elicit their contribution and participation in whatever form they thought appropriate.
To the first, I saw Anders Hejlsberg talk about new features in C#, and a new
set of slides showed up, different from what was in the PDC deck; in particular,
C# has added support for some new syntax, the most striking detail being nullable
types.
(To those who are MVPs, by the way, I have learned explicitly that these two
features are not considered "sensitive"; therefore, even though technically
under NDA, Microsoft would like to hear more about peoples' thoughts on the
subject.)
One of the more difficult aspects of using .NET with relational database data
models is rooted in three-valued boolean logic. It's the age-old question DBAs
love to use to trick interview candidates: Q: how many values of BOOLEAN are
there? A: true, false, and NULL. The same is true for just about every relational
data type, which is why "NOT NULL" appears so often on database table
constraints. Dealing with NULL values in .NET value types is a royal pain, since
value types (until now) can never hold a null value. (Granted, they can be boxed
into an object reference, but then they lose their properties of being a value
type.)
To fix this, the C# team has introduced a new syntax, that of the "?"
type, the nullable type. By writing
int? x;
we are telling the compiler and runtime that this is, in fact, a type that
acts in all ways like a value type, but in fact can possibly hold the value
"null", as in
int? x = null;
Testing x for a null value is as easy as testing it for any other numeric value;
either an explicit comparison against the null literal, as in
if (x == null) { ... }
or C# permits the use of a new binary operator, the "??" operator,
similar in spirit to the ternary operator (the ": ?" operator), as
in
int xvalue = x ?? 0;
which says, roughly, xvalue will be set to the integer value of x, unless x
is null, in which case the value will be 0 (that expression just to the right
of the operator itself). In essence, this is shorthand for
int xvalue = (x != null ? x : 0);
From there, the C# team also chose to allow for "lifting" the nullable
type into its regular type equivalent, which in turn allows for regular relational
operator access
Under the hood, nothing has changed, believe it or not; this was introduced
as part of the support for generics, via the System.Nullable<X> type.
Nullable<> is a generic wrapper around any value type, and introduces
a boolean property "HasValue", to indicate whether the wrapper actually
has a value in it, or is in fact pointing to null. The conversion between int?
and Nullable<int> is purely a linguistic one, much in the same way the
"conversion" between int and System.Int32 is. (Nullable<T> was
introduced during Anders' talk at the PDC, see the slides at http://microsoft.sitestream.com/PDC2003/TLS/TLS320_files/Botto_files/TLS320_Hejlsberg.ppt
for more details, or his talk at http://microsoft.sitestream.com/PDS2003/TLS/TLS320_files/Default.htm
for the audio to go along with the slides.)
Debate raged somewhat during the presentation, particularly surrounding the
"lifting" of nullable types as part of relational operations, such
that
int? x = null;
int y = 5;
if (y < x) { ... }
x will be automatically promoted to some integer value, in this case, 0. Several
attendees were particularly upset about the syntax Anders presented for checking
for null in equations:
int? x = ...;
int? y = ...;
int p = (x ?? 0 + y ?? 0) * (x ?? 0 - y ?? 0);
Needless to say, the jury is still out on this feature, and the C# team was
very interested to hear further feedback on the idea.
Meanwhile, during my five days in Redmond (I stayed an extra day to film a
round of TechTalks, which you will see appear on the site very soon--no hints
as to who participated, though, that would be giving away the surprise ending),
I found myself almost besieged by various MVP attendees and Microsoft employees,
everybody wanting to comment on TheServerSide.NET in some fashion, all of it
positive. Several MVPs sought to find out what it takes to write for us (send
abstracts to editor@theserverside.net),
how to get book excerpts online (send requests to editor@theserverside.net),
how to pursue case studies for the site (send suggestions to... oh, I think
you get the idea by now), and so on. The stream of interested parties was seemingly
endless... and exhiliarating. We've definitely caught the eye of some people
at Microsoft, and they're watching us like proud grandparents.
In the end, it feels like it's been only a few weeks since the site went live,
yet already three months have gone past. Our baby has started to sit up, smile
at the world going by, and react to things happening around it. Members have
started to contribute news posts, which I heartily encourage, and discussions
have started to settle in to the hard-hitting technical back-and-forth that
TheServerSide name is associated with. We have so much more to see yet, and
so much more to do, but thus far, it looks--and feels--like we're off to a good
start. We'll check in with you again in three months, at the six-month anniversary
mark, but if there's anything you'd like to comment on or critique, you know
how to find me.
Oh, and did I show you slides from our last vacation? Hang on, I know they're
around here somewhere....
Authors
 | Ted Neward is a Java and .NET author, instructor and speaker who lives
in the Sacramento, CA area. He is the Editor-in-Chief of
TheServerSide.NET. His personal weblog, on both Java and .NET, can be
seen at http://www.neward.net/ted/weblog, and he can be reached at
editor@theserverside.net. |
|