You Learn Something (Scary) Every Day

Well it turns out you can actually use 'goto' statements in C# !!

    private void button1_Click(object sender, System.EventArgs e)

    {

        goto done;

        MessageBox.Show("Bet this doesn't get shown!");

        done: return;

    }

Conversation overheard in the next cubicle:

I didn't realise that VB.net still has 'goto' statements. Scary.

Want to know something even scarier?

(pause for a beat.)

C# has a goto statement too.

Really!?

Yeh, but no one ever uses it.

Why not?

Cause you'd be shot. That's why.

 

I'm currently writing a book about how to build your first product. If you want to build your first product, please sign up to be notified when the book is available.

(By the way, I read every comment and often respond.)

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.