With a title like that, what else could you expect?

Most of us test if a number is less than zero to see if it's negative. But not John's colleague ...

If (Mid(CStr(cppObject.GetValue()), 1, 1) = "-") Then ...

... and speaking of testing things Simon White ... what do you get if something is not true but not false? Simon White shows us ...

//ED: allocatedLimitOnly declared as a boolean above ...
if (allocatedLimitOnly) {
 processAbridgedCalculations();
} else if (!allocatedLimitOnly) {
 processFullCalculations();
} else {
  resetAllocationStatus();
}

Next we hear from Andrew, who found a very interesting way of displaying "0" on a web page ...

  <%# DataBinder.Eval(Container.DataItem, "0") %>
  ... and on the codebehind ...
  DataTable objTable = new DataTable();
  objTable.Columns.Add("0", typeof(string) );

And finally, Grant shares with us one of the greatest things about the language Haskell: ...

2. Ease of understanding
Functional programs are often easier to understand. You should be able to understand the program without any previous knowledge of either Haskell or quicksort. The same certainly cannot be said of the C program. It takes quite a while to understand, and even when you do understand it, it is extremely easy to make a small slip and end up with an incorrect program. Here is a detailed explanation of the Haskell quicksort:

qsort []     = []
qsort (x:xs) = qsort elts_lt_x ++ [x] ++ qsort elts_greq_x
   where
     elts_lt_x   = [y | y <- xs, y < x]
     elts_greq_x = [y | y <- xs, y >= x]

Whoops! I almost forgot (well, actually, I did forget) this bit from Bo Rasmusson ...

I found this in some production code:

int iChkShut; // variables MUST be initialized, not sure why
Funny enough, the parameter iChkShut is used (uninitialized) for comparisment a couple of rows later.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!