CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Karl Seguin

developer @ Fuel Industries ottawa, ontario

September 2006 - Posts

  • Vista can't run VS.NET 2003

    I'm going to jump on the "I'm outraged" bandwagon and blog my disappointment, yet again, with the VS.NET team. It's official, you won't be able to use VS.NET 2002 or 2003 with Vista and VS.NET 2005 with SP1 will work but with some "compatibility issues".

    Thankfully, the VB6 IDE will work. I bet there are a couple people laughing their asses off at the rest of us right now.

    I have to maintain code in 2003 so <insert won't buy your product threat here>. 

    Anyways,  very quickly from the top of my head:

    - Visual Source Safe sucks (although 2005 _is_ better)
    - Versions of the .NET framework are tied to specific versions of VS.NET
    - For all versions of VS.NET, service packs are very few and very very far away (despite serious bugs)
    - VS.NET 2005 is still a buggy IDE - I still get compiler errors for things that don't exist, large projects are problematic
    - Features which should be IDE features, such as E&C and Refactoring are somehow language features
    - Google is faster and better than the integrated help system
    - A lot of people are unhappy with the VSTS model and price (though I'm not really one of them)
    - VS.NET 2002 and 2003 won't run on Vista

     
    On that last and newest point, I think I see a very unique and good opportunity for JetBrains here...


    I would have simply posted my agreement with Frans and not populated the blogsphere anymore, but anonymous comments are disabled...I still think 1/2 the bloggers on weblogs.asp.net have no clue that people can't register...what's the point of blogging if people can't comment?

     

  • Funny - Newsgroup post about OutOfMemoryException

    This just got posted to the ASP.NET newsgroup:

    I'm getting an OutOfMemoryException when I initialize a byte array in
    C# like this:

    Byte[] test = new Byte[420000000];

     

    Atleast he/she figured out what line was the likely culprit.

  • ASP.NET 2.0 Project Model - Continues to be a thorn in my side

    I know this has been talked about to death, but the introduction of the not-so-new project model in ASP.NET 2.0 as the default (and only (at the time)) model continues to be a pain in my ass. I always start off using it, running into one limitation or another, and switching to the deployment project or the one that makes it act like it did in 1.x (whatever it's called).

    I can't remember where, but I'm pretty sure Scott Guthrie acknowledge that the new model had a greater [negative] impact on enterprise developers than was expected. Hopefully the ASP.NET team knows that it isn't just enterprise developers migrating from 1.x to 2.0 that are having problems with the new model.

    It's ridiculous the volume of questions relating to the new model that is asked in the public newsgroup. If it were possible to calculate, I have little doubt that it was responsible for more question/confusion than any other feature of ASP.NET (with the membership provider being #2...and atlas quickly climbing the charts). If both sides of the spectrum are stumbling around like crazy, who the heck is this feature for? The new project model and deployment project pretty much solve the enterprise developers problems, but everyone else is just confused over the added complexity. How do I add a default namespace? How do I reference a page / user control class? How do I add a handler/module in my web.config? What impact will it have on my typed datasets? Not really solved yet - SP1 should help.

    It just isn't clear to me who this new feature was for. It seems like a power-user feature that the power user's just didn't want, and that left everyone else a little confused. The fact that the new-old project model was finally released is both a blessing and an annoyance - they've acknowledge the problem and come through to solve it (except for the mass amount of people who don't know about it) yet it's clear that there needn't be a problem in the first place.

    Introduce breaking changes to your API only after great reflection

  • 07, 08, 09, XX - Years of the .NET Programmer

    Since it's very beginning, .NET has been a dominate player in the market place.  Within a couple years, Microsoft was able to leverage it's unique position and assert .NET as a power house. For many of us it's lead to great personal growth and opened new opportunities. Job positions are plentiful (CNN named .NET one of the top 5 "Big demand, big pay" jobs) and industry growth continues at an amazing pace.

    What's really impressive is that all this has happened with only partial support from Microsoft. It's been hard for desktop applications written in .NET to gain the same traction as, say, ASP.NET applications - simply because you can't rely on the .NET framework to be installed on the user's PC.

    With the eminent release of the .NET Framework 3.0 on Vista and XP, .NET is going to go through an insane surge that will make it's initial release seem timid. We aren't just talking about migrations either. The rich multimedia capabilities of the .NET Framework 3.0 coupled with the vast market penetration of XP and Vista is going to result in the emergence of completely new markets. It'll be like Web 2.0 for the desktop - except for real.

    CNN thought .NET programmers were in demand before? I'm glad I don't work in HR.

    If you're actually enthusiastic about programming and want to be on the cutting edge, download the CTPs today and start playing around. As best as I can tell, Microsoft is throwing it's entire weight behind this. Microsoft is basically saying "This is where Windows programming is going" and where Windows programming goes, so too does the money.
  • TDD Lesson 5 - UI and Database Unit Testing

    We unit test because we think we get more out of it than we put into it. The upfront cost in time, which is paid for in money by our employers and clients, is paid back by easier maintenance and more stable code. Sometimes the payback is great, sometimes it isn't and sometimes you'll have the necessary information beforehand to make that determination (and sometimes you won't).

    When it comes to unit testing the UI, I'm of the opinion that the value just isn't there. Maybe the tools have gotten better since the last time I seriously looked at it - fair enough. I'm certainly not saying the UI shouldn't be tested, simply that unit tests might not be the most effective tool. That doesn't go for the entire UI though - a lot of components can be tested just as easily as anything in the business layer. I'm mostly talking about classes that site in your App_Code folder (assuming your using one) and help support the actual UI.

    And this is where I ran into problems. I couldn't add a reference to my web project from my unit testing project - huphmmm. Maybe I was just doing something stupid, but knowing how the 2005 web project model works, I wasn't particularly surprised. The new project model is one of the main reasons I spend less time in the newsgroups - just too many questions/confusion about it (I'm sure it's died down, but when 2.0 came out, it was all we'd hear!). So I switched to the 2005 Web Application Project Model and solved my problem (after having to add a lot of protected declaration). So I'm now able to test my GetIndicatorIcon(Indicator indicator) function just like any other. (On the positive side, I think this motivates developers to move this code outside of their pages/user controls and intostraight up classes. Just because you're in the UI doesn't mean everything needs to be a codebehind).

    On the flip side, I think there's tremendous value (at least in my case) in unit testing my data layer. I haven't started yet, but I pretty much plan to follow Roy Osherove's approach  (also available @ msdn). I plan on being able to install a fresh database from code (just ExecuteNonQuery all my create table/sproc/function and the necessary inserts). In the past, RedGate products have helped get this off the ground. Create it into a temp database from my TestSetupFixture, and drop it in my TestFixtureTearDown. If Roy's transaction approach doesn't work with a particular test, I can drop the existing database and start from scratch with ease. The approach might be less fun to manage for a large database, but I'm pretty sure it'll fly straight for me.

     Technorati Tags: , ,

    Posted Sep 11 2006, 08:52 PM by karl with 3 comment(s)
    Filed under:
  • macromedia / adobe's development center REALLY sucks (again)

    If you, or someone you know, has any influence whatsoever on Adobe, please exercise it and let them know their "Developer Center" sucks. I've blogged about this before, but I've come across even worse examples lately

    I went to the main ASP.NET development center and the very first article is "Life after ASP". I was surprised that people were still writing about the transition, since it has been over 5 years, but whatever. I click on the article - and I somehow get brought to the "Cold Fusion" category. So I start to read about all the new things .NET offers over ASP.NET. There are a lot of flaws in the article, but it's clear to me that this thing was written 4-5 years ago - it's not actually dated (stupid stupid) but I'd put a lot of money on it.

    The article basically goes on to suggest that Cold Fusion might be a better choice for ASP programmers than ASP.NET and goes on to explain Cold Fusion. I'm sure in 2001 I would have laughed at that prediction...but this is seriously the first time I've even heard of cold fusion in the last 3 years.

    I realize Adobe inherited a lot of this from Macromedia, but some of it really needs to be cleaned up / out. Even if they just displayed a "date published", it would help people gauge the value of each article.

     

  • Minimizing duplication in sprocs

    Not too long ago, I was experimenting with ways to minimize some code duplication in sprocs. Specifically, I wanted to figure out a way to centralize the SELECT X, Y, Z parts of my stored procedures.

    For example, I had the following three sprocs:

    • GetAllArticles
    • GetArticleById
    • GetArticlesFromTags

    I wrote GetAllArticles first, and it was a basic sproc:

     SELECT ArticlelId, Description, DateSubmitted, Status
            FROM Articles

     
    Eventually, I wrote GetArticleById:

      SELECT ArticlelId, Description, DateSubmitted, Status
            FROM Articles
            WHERE ArticleId = @ArticleId

     
    Humm...I'd done this a thousand times before...and like always, something didn't seem right. These selects are mapped (straightforwardly and manually) to an Article object. The problem comes if I add/remove a property. I change my 1 class definition and my 1 mapping, but I need to change each and every sproc where I pull an "Article", which might be a lot.

    My solution was to let my Stored Procedures get the primary keys, store them (maybe in a temp table?) and call on another sproc to select the actual columns. something like (I'm doing this from the top of my head, since this isn't the actual approach I took):

     
    --GetAllArticles:

    DECLARE #temp (id INT)
    INSERT INTO #temp
        SELECT ArticleId from Articles

    EXEC GetAritlcesFromTempTable
    DROP TABLE #temp


    --GetArticleById:

    CREATE TABLE #temp (id INT)

    INSERT INTO #temp
      SELECT @ArticleId

    EXEC GetAritlcesFromTempTable
    DROP TABLE #temp

     

    --GetAritlcesFromTempTable

    SELECT ArticlelId, Description, DateSubmitted, Status
         FROM Articles WHERE ArticleId IN (SELECT id FROM #temp)

     

    Now, truth be told, I was playing with SQL Server 2005's XML capabilities at the time, so I went the XML route instead of the temp table route, but you get the idea.  I never did get to play with it much, but I always thought the approach had some value.

     

    updated: with some corrections provided by Jorn (3rd comment)

More Posts