Archive for December, 2004

TestDriven.Net

I’ve been using NUnit for about 2 months now, and I love
it.  It’s great to be able to make sweeping changes to the inner workings
of my class libraries, and then ensure that everything is still working, without
having to think about if I missed something.  Just run the tests, if its
all green, you’re good to go!

I first heard about TestDriven.Net from Sam Gentile, he feels its a wonderful tool, and I know many other people do too.
So I tried it out, thinking that it would be nice to have integration into
visual studio with my unit tests.  I gotta say though, after using it for a
little bit, I don’t like it very much.  I’ve gotten used to being able to
glance and tell by the color on the screen what the status of my tests are, and
the output window in visual studio doesn’t give me the same fulfilling
experience.  Also, the NUnit gui is fast and responsive, and I missed that
as well after using visual studio to run the tests, because its just another
thing to slow down the IDE, I really didn’t mind having to run a separate
application to run my tests, especially since they are database intensive and
take over 100s to run them all. 

One thing that I couldn’t use was the Test With Debugger
feature because I am using Visual C# Express 2005, and I can’t seem to
debug.  But what I usually do when I use NUnit, is just attach the IDE to
nunit-gui.exe in order to debug my tests.  I was comfortable with this, but
I think that feature of TestDriven.Net might make me keep it
installed.

Does anybody feel the same way? Or am I a moron who’s out on
a limb :-)

That tricky Ken Thompson

This is a pretty cool way to give yourself access to many, many computers!!

Blogging API/Tools

I’ve just recently started blogging, and I already crave a
desktop app to manage my blog.  All the tools that I’ve come across allow
you to post entries, edit a post, delete a post, and edit your categories. 

I’m looking for more. 

I want to see my referers and feedback, I want to be able to
respond to feedback as if it were an email, just hit reply, enter my message and
“Send” to my blog.  It’s annoying to have to go to my website, log in, and
click around in the .text admin screens to get current information.  When I
browse to my
metablogapi.aspx page, I don’t see any
available web services that would allow me to add feedback or get referer
information, so it appears that these actions are impossible.

So, does anyone know if these services are currently
available, or are being planned, maybe when Community Server comes out?  I
personally would pay good money for an app with an Outlook feel to it, that
would allow me the desktop control that I’m looking for.  I’m writing this
post using the beta of
Visual Blogger 2004.  It’s written
in .net, using the
SandBar Windows Forms controls, so
its got the look that I want, but its in the beta stage.  If Visual Blogger
matures and more web services are exposed on the server, this would be the
perfect fit, IMO.

Let me know what you guys think,
thanks

Great picture

Check out this picture of what scientists in 1954 predicted a “home computer” would look like in 2004!

DNR, generics, and O/R mapping

I recently discovered the radio shows over at DotNetRocks hosted by Carl
Franklin
. These shows are pretty good, I love that
you can download the full mp3 show, I’m downloading all of them and I put them
on my
Dell DJ and listen to them in the car; it
makes the drive to work much more appealing.

I’m in the middle of the show with Mark Pollack, Ted
Neward
, and Don
Box
, which is especially interesting because these
guys are not afraid to push each other’s buttons.  They talked about
generics in java, and how
Sun just put it into jdk 1.5 because of
all the hype that C# was getting for putting generics into Whidbey.  While
java supports generics now, you don’t get the total benefits of generics like
you do in C# because all the java compiler does is convert all the generic types
into objects, so you still have the performance overhead of the boxing
operations, whereas in C# if you define a List<string>, it really is a
List of strings.

The part of the conversation that I’m at right now is where
they are all discussing object relational mapping, and the problems with current
attempts to transpose relational data into language objects.  This topic is
particularly interesting to me, because we use some custom o/r mapping objects
at work, in C#. 

They used a Person object as an example, so suppose you have
a person table in your database, and a corresponding Person class in your
application.  When you are accessing the Person instance, you would supply
the primary key, say 1, of the person that you want to access. So your
application needs to go to the database and retrieve the fields of the person
table, and populate your Person instance.  The problem is what fields
should the application retrieve?  Do you grab all the fields, even if you
just want that person’s email address? Thats a waste of database overhead. 
But you cannot just load every field on demand because the situation will arise
where you need all or most of the fields, and its silly to query the database
separately for each field.  So what to do?  In our implementation at
work, I load all the fields at once.  I find the performance is not an
issue, even for the case of one table that has > 100 fields.  So IMO,
loading all at once is not a problem.  But Carl made a suggestion that I
thought was really clever.  He suggested using custom attributes to specify
which fields are loaded by default, and which fields are “lazy loaded.” So for
our Person class, maybe FirstName, LastName, Email, and Address are always
loaded, and then Phone, Company, Fax, City, State, Zip, Country are only loaded
when we explicitly access those fields.  This scheme would work very well
with that table I mentioned with many fields, and I think the benefits would
certainly be seen if you had a table that was storing blobs, so you could load
all the fields besides the blob, and just grab the blob when you actually needed
the binary data.

This show is compelling so far, I’m looking forward to the
rest of it on my way to work Monday.

Smarter, better, browsers (besides Firefox)

I work at a software company that primarily develops web
based apps.  Our core product is a personal organizer app that manages your
contacts, email, calendar, blah blah blah, all the same stuff that thousands of
applications already do. I believe ours is different because although it is
deployed over the internet, there are virtually zero postbacks to the
server.  Once you login, we make HEAVY use of dhtml and XMLHttpRequests to
send and receive data from the server.  One of the coolest things about the
app is that the users state is preserved just as well as Outlook or any other
desktop app. 

I bring all this up because Jon
Udell
posted about the need for a better, more powerful
browser
in order to successfully deploy more complex
applications over the internet.  I think in an academic sense he is
correct, I think that there ought to be a kind of web services browser, the kind
that
Adam
Bosworth
has talked about on many occasions.  I
also agree that maintaining state information is of utmost importance, as this
is a primary difference between a windows app and a web app.

We maintain support in our app for Firefox as well as IE,
and the only change that I wish for in the realm of browsers, is for Microsoft
to release a new version of IE with an improved Javascript engine.  When we
test our app, the performance and responsiveness of Firefox far outpaces
Internet Explorer in every aspect; the xml requests return faster, the initial
page loads faster, and it renders the dynamic markup faster.  Kudos
to 
Ben
Goodger
and his team of developers.  So while I
think there will be a need for different, perhaps better,  browsers in the
future, I believe we can still make progress with our current
architecture.

Current Influences…

James Avery wants to know what music
people have been listening to lately, here’s my list:

Particle - I saw them live a few weeks
ago, they’re a progressive rock band, I guess, if you’ve heard of the Bonnaroo
music festival, they played there last year, its great music for the car; I’m
listening to their album
Launchpad as I write this.

Sum
41
- I really like their new album, Chuck, its sounds like they have matured
their sound a bit since their last release.

Green Day - By now, most people have heard American Idiot, but I gotta put it here,
its definitely been getting some play time.

Phish - I recently heard their album Hoist, and I like it a lot. 
Sometimes I think there is just too much Phish out there, but I really enjoy
this album.

Charlie
Mars
- I heard his single “Gather the Horses” on the
radio and had to get the album off of amazon.  The single is exceptional, I
can listen to it over and over again, and his
self titled album is great.

 

Code Generation

I know this was posted awhile ago but, I have to say, code generation is a very good thing.

I wasn’t sure how to go about doing it the right way, but finally ended up using the same technique described in the article. You publish a class file, Foo_Generated.cs, which contains all published code. You then hand code a file Foo.cs, that inherits Foo_Generated.cs. You can put anything you want into Foo.cs, and still have all the power of republishing the generated file. I’m using this technique in our current project at work, and one file that I created in a matter of minutes has over 2000 lines of code in it!!! If I had to do all that by hand, it would’ve taken sooooo much longer, and there would have undoubtedly been many many typos and mistakes. So, hand typing all the nasty plumbing code = 5 hours, generating the code so you can start beer friday a little earlier………priceless.

My first post!

Welcome to my blog, I’d like to talk about .net, C#, asp.net, and all other things software related. I’m just trying to get a handle on how blogging works, I’ve been reading a bunch for awhile now, but this is my first blog that I’m writing. We’ll see how it goes!

-ben