Alliteration and an obscure synonym of "jumble". You know that can mean only one thing ... and let me say ... it's a looooong one today!

We'll start out with this simple piece of code that Jake Vinson tripped over while chasing bugs ...

if(3 < 4)
{        
  if(chk.value == 'Yes')
    fld.value = 'No';
  else
    fld.value = 'Yes';    
}

And speaking of pointless code, John pulled this line of triply-redundant code from a Java production system that could be fairly easily simplified to ";".

isActive = (isActive == true) ? true : false;

Laurie F wrote in to share a tricky bug that took almost a week to debug. It was about twenty-five years ago, and in COBOL on a good ole' IBM 4341. It may be in a foreign language to most here, but see if you can spot it yourself ...

       77  FIVE               PIC S9(4) COMP     VALUE 4.

The next bit of code was submitted twice, though from two different readers (Han and Lee) a number of days apart. Now I suppose you could say there are times when this hack is needed (this was not one of those times, the maintenance programmer could have easily modified the MTProcess.c file instead). No less, it still is fun to see "#define private public" ...

#ifndef _IPProcess_h_
#define _IPProcess_h_

#undef private
#define private public
#include 
class IP_MTProcess : public MTProcess
{
public:
	IP_MTProcess(pfnDoubleStatic func, void* arg1) : MTProcess(func, arg1, NULL) {}
	~IP_MTProcess()	{ CloseHandle(_tid); }
};
#undef private
#define private private

#endif // _IPProcess_h_

Next up, George chuckled when he came acrosss this little piece of code ...

Response.Write LCase("SUBMIT ORDER")

Then of course there's Jared M who was surprised to see how his former coworker (with "over 15 years experience in the industry") negated numbers ...

if (trx.Amount < 0)
    trx.Amount = Math.Abs(trx.Amount);
else
    trx.Amount = Convert.ToDouble("-" + trx.Amount.ToString());

It seems everyone has their own way of finding a way to avoid multiplying numbers by -1. Shaun Katona's colleague demonstrates another YAWN (Yet Another Way to Negate) ...

int makeNegative( int n )
{
  int num;
  num = n - ( 2 * n );
  return num;
}

Negation isn't the only part of 7th-Grade mathematics lacking from some programmers, as demonstrated by Rick Harris' submission ...

IF (current_num - prev_num = current_num) THEN

Are ya WTF-ed out yet? Let's hope not, otherwise you'd miss out on Duane Homick's discovery of the strftime documentation ...

%S is replaced by the second as a decimal number [00,61].

Chris scratched his head at this format string / formatting combination ... writer.

writer.WriteLine(
  "{0}{1}{2}{3}{4}",
  DateTime.Now.ToLongTimeString(),
  " ",
  DateTime.Now.ToLongDateString(),
  " ",
  debugMessage);

And finally (Phew!), Eric N found this while looking in how the .NET framework implements System.Drawing Graphics.DrawImage(). It poses an interesting philisophical question ... if an object does not exist, how could it be doing something?

public void DrawImage(Image image, int x, int y)
{
  if (this == null)
  {
    throw new ArgumentNullException("this");
  }
  if (image == null)
  {
    throw new ArgumentNullException("image");
  }
  int num1 = SafeNativeMethods.GdipDrawImageI(
    new HandleRef(this, this.nativeGraphics), 
    new HandleRef(image, image.nativeImage), x, y);
  this.CheckErrorStatus(num1);
}
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!