Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Babilinski · Apr 30, 2011 at 06:27 PM · goto

there is something i dont get (C# )

what dose Goto mean in C#?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

7 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Mike 3 · Apr 30, 2011 at 06:47 PM

The same as in most other languages - that you'll generally get a slap for using it :P

"The goto statement transfers the program control directly to a labeled statement"

http://msdn.microsoft.com/en-us/library/13940fs2(VS.71).aspx

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by hellcats · May 05, 2011 at 04:30 PM

The reason we're giving you such a hard time about goto is that it has a long history in Computer Science as a bad programming method. You do need transfer of control capability of course, but goto lets you transfer control to anywhere in your program, which can be very confusing when trying to figure out a bug or trying to understand someone else's code.

You can get by in almost all situations with "structured" control statments: while, if-then-else, for, switch, break, continue, return, yield, throw

These are structured because they sort of turn your program into an "outline" where statements control only more deeply nested blocks of code that appear immediately after it inside {...}. There are very few places where goto is actually needed (some would say there are no places). If you think you really need goto, then go ahead and use it, but most likely you could reorganize your code to make it understandable and modular by avoiding goto.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
-1

Answer by Babilinski · May 02, 2011 at 06:50 PM

so Dont use goto?

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · May 05, 2011 at 04:38 PM 0
Share

This isn't an answer.

avatar image
0

Answer by Dan 24 · May 01, 2011 at 01:33 AM

"In 1978, Berkeley scientists did a study on the effects of GoTo on rats. Twenty rats in a control group were fed a normal diet, while twenty other rats were forced to program in Apple BASIC. Their health was to be monitored for a month, but after two weeks all of the rats in the programming group had melted into a dense goo that tasted a little like quiche. " GoTo considered harmful

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by hellcats · May 01, 2011 at 03:50 AM

Goto is short for "Gotoga" (or go-Toga) which is a sideways reference to the 1978 cult classic "Animal House" starring John Belushi. Use of "goto" in programming languages (such as C#) means that you are thumbing your nose at established and accepted programming design principles and just doing your own "thing". Language designers of course are all aging hippie types themselves, and left "goto" in the language as a sort of homage to the anti-establishment sentiment. By using goto in your own programs you are making a stand against the "man" and keeping hippie culture alive in our modern connected world without raising the ire of your bosses or marketing types who will never know what it means.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

IEnumerator problems in C# 2 Answers

Is Input.GetAxis meant to return to 0 on key up? 1 Answer

how can i fix this up so i can teleport? 1 Answer

Question regarding this line of code 1 Answer

how to convert int to string in C#? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges