Don’t debug like Google!

Everybody loves Google because they do a great job at everything, but there are two things I noticed on YouTube.com that my fellow flash developers should avoid in their Flash applications.

While watching a video I noticed debug statements appearing in my FlashTracer window. Although it is pretty common to see similar debug statements on websites that have flash content, it should not be common and it is very easy to remove these statements for production content.

99% of these statements were typical, but there were a couple that, although funny, could be embarrassing. Look at the two lines of text I highlighted in the left column of this screenshot:

YouTube.com screen capture

Although it is hilarious to see these statements in code from a reputable company, there are a couple reasons why they should not be there.

I avoid writing this kind of stuff in my code because most developers know another developer who has been burned by writing these type of statements and they never learn. Google can get away with this because nobody is really going to be offended and they’re their own client. But, when I’m working for a client I follow these two rules:

  1. Never put anything in your code that you don’t want your client or boss to see.
  2. When you do comment your code, be professional enough to omit them when you compile for production!

When you compile/publish in Flash, remember to select “Omit Trace Actions” in the publish settings to prevent your trace statements from appearing in the compiled swf. Sometimes, I might leave in a few traces so I know the version of the app that the client uploaded or other info that might be helpful for debugging problems.

Here are some other funny examples of code I have seen in other applications that should be omitted for production…

  • The connection just got tea bagged – reset and reload
  • Fuck bandwidth detection script its taking too long or not working so fuck it hard
  • This feature does not work and crashes the player fix laterz
  • HACK HACK HACK HACK HACK this scuks

The best part about the google debug statements, is that you can see them for yourself by installing the FlashTracer add-on for Firefox and the Debug Flash Player, then browse over to YouTube.com and watch a video. And, although I named this post after Google, you could also look at another example of what not to do in this article. It’s about a bunch of unprofessional comments from some Microsoft Win2K source code.

UPDATE: Google promptly removed these statements after about 130 hits to this page from google.com (not referrers, but actual native traffic from the company domain).


24 Responses to “Don’t debug like Google!”

  1. Matt says:

    You are aware that this is from the YouTube guys, if this is the old player I can’t tell, and they were a startup. It’s not necessarily Google who is putting in these comments. Nice find though. By the way, can you tell us which player it was? It would be interesting if it is the new one which would be made under the Google name.

  2. Chad Upton says:

    Matt, ya you’re right… it could have been the original YouTube guys who put it in there, but it’s Google’s responsibility either way and I’m pretty sure Google compiled the latest player for 2 reasons:

    1. It has code in it that is only supported by flash player 9.0.28 (which is a few months old at the most).
    2. I did a search to see if anyone else has noticed this and I found someone else blogged about this on Feb 21, 2007 and didn’t mention the “fuck yeah” comment. Then there is a comment at the bottom of the blog from a later date where someone mentions the addition of the “fuck yeah” comment. And of course, Google has owned YouTube since long before Feb 21.

  3. harpoonflyby says:

    if you don’t like foul language, don’t go into the garage

  4. Adrian says:

    Seriously, you should stop being such a nerd and get over it. As far as I’m concerened it doesn’t matter and will never matter, beyond the fact that if it just works, no one GIVES A FUCK!

  5. Googlified says:

    The Mad YouTube Engineer…

    Flash developer Chad Upton noticed something unusual about the debugging comments in YouTube’s video player when watching a video on YouTube. While 99% of the debugging comments are “typical”, he said, a few irritating ones got caugh…

  6. Ahmed says:

    Meh, a lot of programmers do those things… nothing to get all upset about. Besides, who cares?

  7. GilbertZ says:

    Funny catch, but I agree, it’s probably the YouTube guys and nothing Google could have done to catch it. They probably found out here.

    I’ve been guilty of this type of mistake a couple times. Once at a big meeting I had a disagreement with the developer team who wanted to release our product w/o a “delete folder” feature. We were using the Sales Manager’s machine to demo @ the meeting. They usually didn’t give me what I wanted (as they didn’t have to deal w/ customers..& their motto was the user is the enemy). They felt the “feature” would delay the product and why was Delete so important? So I gave them a demonstration.

    I created a new folder. Typed FUCK. Then sat down.

    The CTO was a Hasidic Jew so it kind of shocked everyone in the room that I typed a profanity in middle of this big meeting, but he cracked up laughing and said “Add delete folder to the feature list.”

    After the meeting the Sales Manager said he will never let me touch his machine again, as he had a meeting w/ a client and couldn’t do the demo :)

  8. ransom says:

    meh. linux guys have had cursing in their kernal source for years. i don’t see how its a problem. i think what you discovered is that “humans” work at google.

  9. rob says:

    “but it’s Google’s responsibility either way”
    so what is google suppose to go through every single line of code?

    simple mishaps so fucking what

  10. Sai says:

    lol, someone is going to get fired

  11. jason says:

    Chad, you’re an idiot

  12. It sure is a terrible thing when we find out our software was written by actual human beings. I hope we can fix that soon with robot programmers who will never be so naughty. Can we lighten up?

  13. Jesse says:

    Thanks Chad!

    Being an ex-programmer I can totally understand your point. I don’t think any of the previous commentators “got it.” Its not about the shock value, the words used or anything comparable. It is the simple fact that they used messy programming.

    You can have a dirty office, but don’t make your code dirty!

    Cheers and thanks!
    Jesse G.
    Houston, TX

  14. Riccardo says:

    what if a kid read that kind of comment? get rid of them, now

  15. Unprofessional, quite true. But rather amusing, I think.

    I know in some of my programs I’ve wrote big explanations of how things aren’t working like they’re supposed to.

  16. Dave says:

    Who cares.

  17. Matt says:

    In response to the Chad’s an idiot comment, yes I agree, this is what you get now for being a billionaire by selling people content. =D

  18. Steve says:

    I can’t agree with the statement “When you do comment your code, be professional enough to omit them when you compile for production!”.

    These “comments” seem to be somewhat more like debug statements; Debug statements should not contain bad language if they can possibly be seen by anyone outside the development team.

  19. John Doe says:

    Quoting jason above, Chad, you’re an idiot.

  20. Dustin says:

    What is really funny is when the app is developed in india and they are curse in sanskrit…

  21. Matt says:

    That’s not funny Dustin, that’s plain sad.

  22. Gabriel says:

    Chad, you’re right. This sort of thing shows a lack of professionalism. The people who want to hide behind “human-ness” are missing the point. The ipod, you-tube generation will need a few decades to understand a few things. Forgive them, for they know not what they do.

  23. Lou says:

    Chad, you’re not a programmer.

  24. loop says:

    you just found a new daily reader

Leave a Reply