Bloggers Unite!

This is a bit off the topic of software development, but I findit fascinating, so please excuse the detour.

Bloggers bemoan Yahoo’s role in writer’sarrest. Blog: There’s lots of buzz out thereabout a media watchdog group’s claim that Yahoo providedinformation that helped Chinese officials… []

That’s so funny – one of the features of Radio Userlandis that it lists current news stories from several major feeds,letting me perform a single click and turn it into a blog post.Voila, I’m a pretend newspaper!

Personally I find this a bit disturbing – are people signing upfor feeds from bloggers to allow them to be their news filters,carefully applying their bias to whatever stories they want peopleto hear Are we in a world where there are half a dozen sources ofinformation, and there are vast armies of Winston Smithsmanipulating feeds to fit their perspective?

Secondly, this story above details how “bloggers bemoan”(including some snippets from blogs, which is a pretty fragilebasis of a news story), as if “bloggers” are some sort ofcollective consciousness (which has been a bit of a mantra in themedia as of late). Bloggers, as a composite, have very little incommon with each other, and this constant portrayal of someunderlying binding thread is ridiculous. Having, or writing in, ablog is universally accessible. There is no great skill, sacrifice,or motivation in being a “blogger” (why blogger is being linked isa mystery to me – it’s just the word in quotation marks. Sort ofannoying). Furthermore, I’ve been seeing some readership numbersfor some of the most popular blogs, and man are they a world lessthan you would think. Many of them were less than 1% of the dailyreads that I would have expected given the perspective ofblogs.

Visual Studio Quick Tips

Two more Visual Studio.NET quick-tips while I’m doing a flyby(again because I’ve seen so many developers that don’t takeadvantage of these simple productivity improvements)

  • Use a good font forprogramming 
  • Use Windows/Auto Hide All (the menu item) in VisualStudio. The additional space for viewing code and laying outdesigns is incredibly valuable

FxCop & .NET Best Practices

If you do .NET development, you owe it to yourself to useFxCop. This toolevaluates your assemblies (it analyzes the IL assembly, rather thanthe sourcecode itself), and flags possible deviations from bestpractices with varying severity levels. You can also easilycreate your own modules for FxCop, imposing team ororganizational specific guidelines. All in all it’s a very usefultool, and it’s free. Even if you don’t plan on following all of theframework guidelines, it’s still interesting in that it points outnuances that you probably didn’t know about.

This tool has been out for quite a long time, but I’m stillamazed how many .NET developers have never heard of it, let aloneused it, so I thought I’d drop some props for it.

Trackbacks and Comments

Several people have written to ask why I don’t allow comments ortrackbacks. The answer is not censorship, but rather it’s due tothe fact that I desired a totally static “blog”, so the use ofexternal comments and trackback servers is necessitated.Unfortunately the Radio Userland default ones areunbelievably slow, adding significantly to thetime taken to load and render the page. I’m considering options,and if anyone has any suggestions please email me (the link is onthe sidebar). Alternately, given that it’s an open API, I mightjust write my own. Sounds like fun.


.NET, Garbage Collection, and Reference Counting

Garbagecollection in .NET has always rubbed me the wrong way. As aquick recap, garbage collection in .NET (as in Java) works bybasically halting the application and scanning all references fromthe root reference on. It then looks on its heap to determine thatevery object has someone else pointing to it, and if not the objectis freed (through a long process). The heap memory is thencompacted and any references are rebased. The program then restartsuntil garbage collection happens again at some point in the future.This means, for instance, that if you create a System.IO.Fileobject in a short method that opens a file in exclusivemode, and you fail to use the Dispose pattern or explicitlycall Dispose (Dispose being a sort of “garbage collection has somegaps, so here’s something that you can do to expedite at least partof the process”), the file will be locked until some unpredictablepoint in the future that garbage collection runs. You can, ofcourse, force garbage collection, but that throws off the entirelifecycle management and can cause other resource managementissues.

Ultimately it seems like the sort of solution that worksfor relatively small or isolated applications (where itworks admirably – for web apps and web services, isolatedservices, and relatively small Windows Forms apps .NET is afantastic technology, primarily insofar as it reducesdevelopment time), but not as a technology that scales up tolarge scale, highly responsive systems (where you want the loading,resource usage and response times to be predictable andconsistent). This case seemed to be somewhat proven by many of thedelays and issues with Longhorn (Windows Vista), and the backtrackingand reduced reliance on .NET as a system pervasive technology (TheRegister isn’t the most credible source, but it’s just a referenceto the sort of thing I’ve heard throughout the industry). Entirelypredictable.

One change that I would like to see added to .NET – optionalreference counted references, with a second heap specifically forclassic, fragmeted allocation. Reference counting, the oft malignedtechnology behind COM (mostly because people didn’t know how to use it properly),is a completely reliable and extremely predictable and usefultechnology in a completely managed environment for most uses (thereare exceptions where reference counting breaks, but you don’t haveto throw out the baby to clean the bathwater). Python, forinstance, works largely based upon reference counting.

Some might note that Visual C++ 2005 has added“stack” reference types. This really is a bit of syntactical sugar- basically it’s just a variant of the Dispose pattern that, whencompiled, adds an automatic call to dispose when the object leavesthe scope. Not the same thing at all.