ctodx

This Blog

News

Favorite Posts

Archives

DevExpress Newsletter 20: Message from the CTO

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.

Published Jan 27 2010, 09:10 AM by
Filed under:
Bookmark and Share

Comments

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.

January 27, 2010 12:32 PM

Martin

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

January 27, 2010 4:03 PM

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...

January 27, 2010 9:26 PM

James Foye

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

January 28, 2010 11:46 AM

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 :)

January 28, 2010 12:44 PM

Technical Support

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

January 28, 2010 12:54 PM

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...

January 28, 2010 12:57 PM

Jennifer Elkhouri

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

January 28, 2010 2:09 PM

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!

January 28, 2010 2:20 PM

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.

January 28, 2010 2:29 PM

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.  :-(

January 28, 2010 2:41 PM

Sam McPherson

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

January 28, 2010 4:32 PM

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.

January 28, 2010 4:35 PM

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.

January 28, 2010 5:14 PM

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.

January 28, 2010 5:23 PM

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.

January 28, 2010 5:44 PM

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'

January 28, 2010 6:32 PM

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:

codeulate.com/.../fcking-programming

www.vidarholen.net/.../wordcount

And for lots more:

www.google.com/codesearch***&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.

vs.

// 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.

January 28, 2010 11:11 PM

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

proc

'wheeeeeeeee

next

next

Who'd have thought "wheeeeee" would offend?

January 29, 2010 2:27 AM

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.

January 29, 2010 3:39 AM

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.

January 30, 2010 4:56 AM

About Julian Bucknall (DevExpress)

Julian is the Chief Technology Officer at Developer Express. You can reach him directly at julianb@devexpress.com. You can also follow him on Twitter with the ID JMBucknall.
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners