Archives
-
String concatenation - + vs StringBuilder
Countless times I've read that the when doing string concatenation, the StringBuilder class is more efficient than the String "+" operator. I pretty much just accepted that advice until a couple of days ago. But after poking around a bit, it now looks like there's some simple and common cases where in fact the opposite is true.
-
New Microsoft Web Service
MS has released an SDK for accessing Microsoft.com downloads. Nice idea. But what I'd really like to see is a SOAP API for accessing the knowledge base. I use that sucker enough that a rich client UI would be very handy. Plus, it would let me fix the annoying limitation that the kbase UI refuses to remember the fact that I always, always, always search for "All of the words entered" with a limit of 150 articles.
-
.NET naming conventions and protected members
While I've been doing a bunch of .NET development over the last year, I haven't really developed any class libraries until now (been web services and web application stuff, mostly). Being a good .NET citizen, I set the CLSCompliant attribute. I was coding merrily along, using the C# coding standard that I've adopted - camel case for members, Pascal case for properties and methods. Everything was ducky until I tried to add a protected field and a corresponding public accessor property. The compiler complained that this wasn't CLS compliant, since case-insensitive languages like VB.NET can't differentiate between the starts-with-lower-case field and the corresponding starts-with-upper-case property. Doh! Not sure why I never thought of that. The .NET framework style guide recommends camel case for protected fields, but I guess they didn't consider the case where there's a corresponding public property when they wrote that recommendation.
-
Poking around the VS.NET CodeModel
Today was a pretty darn interesting day. I spent a big chunk of it writing a Visual Studio .NET add-in that uses the CodeModel to munge around with C# source code. The experience ran the gamut, from initial excitement at early successes, to frustration as limitations were encountered, to satisfaction when the goals of the project are finally met. It isn't too often that all of that happens all in one day.
-
Red vs Blue
I guess I'm a late comer to the Red vs Blue BloodGulch serial. Holy crap, Batman, it's brilliant. I laughed. I cried. OK, I just laughed. A lot. Those guys are amazing.