Coding: March 2007 Archives

A classic

| | Comments (0)

(From CodeSOD: The Pyramid of Error)

if (error)
  if (fprintf(stderr,"An error occured while writing to the file")<0){
    if (fprintf(stderr,"An error occured while writing to stderr")<0){
      if (fprintf(stderr,"An error occured while writing to stderr")<0){
        if (fprintf(stderr,"An error occured while writing to stderr")<0){
          if (fprintf(stderr,"An error occured while writing to stderr")<0){
            return fprintf(stderr, "An error occured while writing to stderr");
            /* lets stop here, its enough */
          }
        }
      }
    }
  }

.NET never ceases to amaze

| | Comments (0)

http://support.microsoft.com/kb/810218

In essence - when you do a Server.Redirect("SomePage.aspx?SomeParam=SomeValue") .NET conveniently will make that SomeParam persisted over the subsequent requests - i.e. if SomePage.aspx contains a form to be submitted, that form's action will be rewritten to include this param. Neat? No! How do you clear a querystring parameter no longer used? You can't. At least not elegantly.

This is why I prefer J2EE - you have to work harder, but you almost *never* have to implement workarounds to work around unneeded high level features.

About this Archive

This page is a archive of entries in the Coding category from March 2007.

Coding: February 2007 is the previous archive.

Coding: June 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.12