DevExpress Newsletter 20: Message from the CTO

27 January 2010

Reprinting my Message from the CTO from the twentieth newsletter so that you may comment on my thoughts.

Assume your code will be public

Back when I was a younger programmer than I am now, I remember writing cute but honest comments in my code. Things like "This is a hack, I'll fix it later", "This is to satisfy that stupid request that XYZ should happen", "One day I'll speed this up, but at least it works". And some of my identifier names could be a little risqué. All very well, since, of course, I was going to be the only person reading my code.

Then it spread to my test data, making up charming first and last names, ridiculous addresses, lampooning famous people or just coworkers.

Of course, you can guess what happened next. Someone high up caught a glimpse and didn't think it was funny. Oops. Later on, when the code I wrote was actually made public (it happens in the control vendor market, don't you know) a customer looked at one of my comments and started arguing about the situation it mocked. Double oops.

So, if you take any advice from me in 2010 at least let it be this recommendation: write your code assuming that it will be public and scrutinized. Don't play funny games with it. Make sure your text -- be it error messages, test data, comments, whatever -- is squeaky clean. Don't end up on the Daily WTF with a red face.

A fun one this time, but with a serious underlying point.

21 comment(s)
Nate Laff

The sample data sure sounds familiar. In a home building management system (that used DX!) we had sample data that as a joke for one of the community names, we, the developers, had entered 'Morning Wood Farms." It was caught during a presentation and quickly minimized, but for one brief moment, there it was, in all its glory for our would-be customer to see. Oops.

27 January, 2010

When I encountered 'public void HaraKiri() ' I had to smile though.

27 January, 2010
Scott Stephenson

Early in my career, I entered a cvs commit with the comment, "I'm doing this the wrong way only because the moron in charge doesn't know how to program". Well, you can guess who reviewed the cvs commits every night...

27 January, 2010
Jim Foye

I have written smart-ass comments in the hopes that someday somebody else actually would read them.

28 January, 2010
Dave Campbell

I teach part-time for University of Phoenix Online, and when the subject of comments came up in my last class, I told them not to take my word for what I do, look at my production code... do view->source on my site and see if there are comments on the JS.

Then one replied with a smiley face and asked if I always write comments as if I were in a conversation with another person?

Well... yeah I guess depending upon how late at night I'm coding :)

28 January, 2010
Technical Support

You must have covered your tracks in the TP code; after all these years still haven't found any "easter eggs". lol

28 January, 2010
Fred Steffen

LOL! At one company I worked for, we had a mascot for our bug catching component... The Stay Pufft Marshmallow man... It didn't go out to production, but there was a member of the team it resembled (He was huge!) and he never got it lol...

28 January, 2010
Jennifer Elkhouri

So my "bm" variable for BindingManagerBase should be changed?  

28 January, 2010
Dave Lund

I recall many years ago doing a demo for a lady customer, I did not have time to grab the sample company so I used one of my co-worker's datasets.

When "Edible Panties" came up on the product list, I was not sure if we would still make the sale!  Funny now though!

28 January, 2010
William Egge

Once I posted a comment in a developer newsgroup about the company website and asked that its poor quality not be used as a gauge to determine our real company quality because the president had made the page with front page.   The president had some google alert or something for the company name.  A few days later he came to my office and said he had seen my comment.  He thought it was funny but I was embarrassed.

28 January, 2010
Taf Greenstreet

I was lucky enough to learn this lesson in college!

My CS courses (Arts & Sciences school) let us informally compete with shocking names in test data.  When I went to the Business school (for more specific application of my skills) I quickly found they did not have such a competition!  And, sure enough, some original test data (that I THOUGHT I had deleted) appeared during a presentation.  :-(

28 January, 2010
Sam McPherson

Hilarious! Over time I have many well-hidden remarks in code, and enjoy the coder's humor.

28 January, 2010
jeff mertz

Your advice is long over due. It has been nearly 20 years since I first encountered the MickeyMousePointer in some VM Pascal code.

28 January, 2010
Steven Pack

Hi Julian,

Good advice on the comments. Professional coders should produce professional code. Full stop.

On a completely unrelated note, any chance we'll get 3D surface charts this year? I (and probably a lot of people in finance) am itching to stop paying your competitors for one single chart component that DevExpress lacks.

28 January, 2010
Bevan arps

There's another angle to consider, of course...

If, through some grand catastrophy, my test data ever does leak into production, I don't want anyone to *act* on that data. Instead, I want the test data to be *recognised* as bogus data and reported through the appropriate help channels.

It is possible to create test data that is obviously bogus to a human while looking sufficiently like the real thing for the system to process it. Being outrageous or offensive isn't required.

28 January, 2010
Fred Smith

Just good coding practice - profanity and poor taste humour in comments and documentation is bad engineering (and usually quite embarrasing in code review). It's also a sign you're not concentrating on the task at hand - you're making up jokes instead.

Having said that, I'd say that test data needs to be fairly silly (within the bounds of good taste of course). If it isnt, it can be mistaken for real data, which could be disastrous. Case in point: most medical surgeries have a test patient somewhere on their systems, for testing,  training, bug reporting and so on. If that test patient is confused with a real patient, the resulting misdiagnosis could harm someone.

We always called our test patient Scooby-doo. He was on so many pills he rattled.

28 January, 2010
Alan Perkins

In an accounting software company years ago, one of our developers put the following line in as an amusing error for the testers to find: 'Your data is f$%ked' (although the second and third letter were 'uc' .

Somehow it got missed and went into production and one of the customers rang up crying, saying his data was f$%ked'

28 January, 2010
Ryan Smyth

I LOVE reading comments in code with all that wonderful, entertaining goodness. As long as the code gets done well, I really don't care much. Here are a few links to entertain:

And for lots more:***&btnG=Search+Code

As for the whole "professional" thing... BALDERDASH!

I've seen more "professionals" that write the most horrid garbage and don't know their @$$ from a memory leak, all the while maintaining some nonsense, haughty air of "professionalism".

Who cares about the odd f**k, d*mn, sh*t or p*ss? The point to being a professional is COMPETENCE, and not some BS politeness to disguise incompetence.

There's a difference between using profanity and being obscene or offensive. I'd rather read profanity that expresses the frustration of the developer and points out something useful, than roses, rainbows and unicorns that don't add any useful information.

Similarly, there's no need to be offensive or to insult or deride people in comments.

// This is a f**ing sh*tty hack. It needs to be fixed.


// The boss told me to write this f**king nonsense. Blame that jack@$$ when it doesn't work.

The first expresses frustration, which is perfectly acceptable for humans. The second expresses contempt, which just isn't acceptable in the work place. They are 2 totally different issues. The first does not diminish the work. The second does.

Swear away, but be competent and respectful.

28 January, 2010
Maurice Thomas

I got picked up on a loop stress test once. Thought it completely harmless, but it gives you an idea just how uptight some people can be:

for i = 1 to 1000

for j = 1 to 1000





Who'd have thought "wheeeeee" would offend?

29 January, 2010
Alan Livingstone

We once had to decide on a sysadmin account that didnt say sysadmin, and the head of IT had put forward TheFatController  - taken from a kids program about speaking trains.  This kind of stuck with me and I used it when I had started a new job.  I was then asked to pass on the account details to a director who I had never met who was going to have some hands on.  Queue me walking into the office to pass over the details and seeing a guy sitting there about 24 stones....  Eventually said I had forgotten to bring the account details.

29 January, 2010
Kian M

Well, thanks for the tip, funny stuff. Being a young programmer myself, I'll keep this in mind when I'm writing the code for my latest project - a little something for my school.

30 January, 2010

Please login or register to post comments.