December 15th, 2021

What does “Do not launch, but debug my code when it launches” mean?

Visual Studio has an option called Do not launch, but debug my code when it launches.

For a long time, I was confused by this setting. It’s like telling someone, “Don’t drive my car, but wear a seat belt when you drive my car.”

I also tried to parse this as

(Do not launch, but debug my code) when it launches.

In other words, “When my code launches, don’t launch it; just debug it.”

Which makes no sense. “When my code launches, don’t launch it.”

I eventually got clued in that both of those attempts at parsing the statement were incorrect. The intended parse is

Do not launch, but (debug my code when it launches).

In other words, “Don’t launch it right now. Wait for somebody else to launch it, and then debug it when that launch happens.”

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

16 comments

Discussion is closed. Login to edit/delete existing comments.

  • Gustavo Lopes

    The two uses of launch are different predicates, one with two places (transitive) and one with only one place (anticausative). It’s analogous to the storm sank the ship, so the ship sank. This is called causative alternation.

  • Mike Morrison

    Perhaps a single additional word would have alleviated some of the confusion: “Do not launch now, but debug my code when it runs”.

  • Ivan K

    Very useful. I was wondering how this is implemented, but currently searching all the google for “Do not launch, but debug my code when it launches”, or just "debug my code when it launches” only finds this blog entry. A guess would be some user-mode windows api trace call (WMI apparently can do it), or even IFEO if it handles Visual Studio not already running when launch occurs. It could also add code or some...

    Read more
    • David Trapp · Edited

      I would assume it temporarily sets AeDebugger for the filename to itself (and when it’s invoked first checks if it’s actually the right file and not just the right filename, and if it isn’t, runs the process normally and detaches).

  • Mystery Man · Edited

    It wasn't confusing to me. My first and only understanding was very close to your conclusion: "Do not launch. Debug my app when it launches." I had no reason to attribute the sentence's sole adverbial clause to the first predicate. But you read the first predicate as "do not launch my code," thus permitting yourself to misattribute the adverbial clause.

    I have a theory as to why. During my limited interactions with other Microsoft people via...

    Read more
    • 紅樓鍮

      I’m not native in English, but if the sentence really meant “(do not launch, but debug) my code when it launches” my heuristics tell me it would have to be written

      do not launch, but debug, my code when it launches

      with the correct pairing of commas.

      • Raymond ChenMicrosoft employee Author

        Appositives use paired commas, but this is not an appositive. The comma after “debug” is not allowed according to English grammar. You do not put a comma between the subject and the verb or between the verb and its object.

      • Neil Rashbrook

        So in fact there should be no commas at all for the sentence to have this interpretation.

      • Raymond ChenMicrosoft employee Author

        Correct. For the “(Do not launch but debug) my code when it launches” interpretation, there should be no comma. The comma does force the parse as “(Do not launch), but (debug my code when it launches)”, but it’s easy to overlook.

    • Daniel Sturm

      Confirmation bias is a funny thing.

      • Mystery Man · Edited

        And backhanded personal attacks are despicable, my dear fellow. 😊

        But they hurt you more than me. If you keep driving actual humans away, one day, you discover that the entities you’ve been trolling for so long were soulless bots! (For example, judging by the patently nonsense comments below, I believe “Ivan K” and “David Trapp” are Markovian bot accounts.) That’s no better than talking to a wall.

      • Ivan K

        Ah right. I forgot that people who can’t elevate would also want to debug programs. Cheers.

      • Daniel Sturm

        Says the person who accused over a hundred thousand people of “linguistic vices” based on nothing more than “my limited interactions with other Microsoft people via GitHub”.

        I mean particularly nonsensical since you could’ve simply looked at some of Raymond’s previous posts and noticed that he can use intransitive verbs just fine.

      • Daniel Sturm

        Ah yes pointing out that claiming that someone doesn't know or use intransitive verbs - in a blog where there are many, many examples to the contrary - because they made a handful of observations being a classic example of confirmation bias will definitely cause the bot apocalypse.

        Then being insulted by that observation and not noticing that the original generalization and claim was insulting to begin with is also interesting.

        But yes if only I...

        Read more
      • Mystery Man

        Then I hope you enjoy your company of bot accounts that write nonsense about how “user-mode windows api trace call” is connected to the International Federation of Eugenics Organizations. Maybe then, you’ll learn that those who are wrong don’t necessarily deserve being insulted.