This Year’s Company-Sponsored Family Picnic

Scenes taken from the 1913 silent movie “The Drummer of the Eighth”

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Tagged with:  

Avoid Default Parameters in C++

Functions in C++ can have default values for parameters.  Default values are specified in the function declaration, but they are not repeated in the function definition as seen here:

#include <iostream>

using namespace std;

void setVolume(int x=5);

int main(int argc, char **argv)
{
  // Invoke default
  setVolume();

  // Invoke explicit
  setVolume(123);

  return 0;
}

void setVolume(int x)
{
  cout << "Setting volume to " << x << endl;
}
% demo.exe
% Setting volume to 5
% Setting volume to 123

Default parameters are useful in many circumstances, but I recommend against them. It’s better to force the user to always enter an explicit value. This supports the concept of deterministic testing. What happens if the developer decides to change the default value after you created a test for it? If your test assumes the original value, then your test is broken. Gnashing of the teeth would ensue.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Tagged with:  

The 64-Bit Question

Mahmoud, the developer, brags to Steve, the tester, about his 64-bit programming skills.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Tagged with:  

Confessions of a Corporate Lifer

Scenes taken from the 1952 Japanese film Ikiru ((生きる)

Akira Kurosawa, Toho Productions

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Tagged with:  

I just like the title.  Nothing to read here.  Please move on.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
 
Page 20 of 22« First...10...1819202122

Random Site Quotes

“Huh.”
© 2009-2011 TestDeveloper.com
Powered by WordPress
Content provided by John L. Whiteman and his Slam Carrot Long Ears Gang