انجمنهای فارسی اوبونتو
کمک و پشتیبانی => انجمن عمومی => نویسنده: abdossamad2003 در 08 آبان 1400، 07:30 بظ
-
با سلام
می خواستم بدونم در لینوکس پوسته bash آیا دستوری مانند goto وجود دارد که فرایند به خط مورد نظر انتقال یابد؟
با تشکر
-
تا جایی که من میدونم، نه. هرچی میخواهید پیاده کنید رو باید با حلقههای تکرار و دستورات شرطی انجام بدید.
-
نه. در کل در هیچ زبانی استفاده از goto درست نیست و نباید ازش استفاده بشه.
-
نه. در کل در هیچ زبانی استفاده از goto درست نیست و نباید ازش استفاده بشه.
نه در بعضی شرایط خاص هنوز هم کاربرد دارد.
https://softwareengineering.stackexchange.com/questions/566/is-using-goto-ever-worthwhile
(https://softwareengineering.stackexchange.com/questions/566/is-using-goto-ever-worthwhile)
https://www.sciencedirect.com/science/article/pii/S0167642305000924?ref=cra_js_challenge&fr=njs
-
اون رو هم ببینی تهش نوشته در تمام این موارد goto برای رفع مشکلی استفاده میشه که خود کدنویس ایجاد کرده و در حالت درست،بااید کد رو درست نوشت.
-
اولی یا دومی؟
-
اولی
I'd argue, as many others would argue, that in all of these cases, the usage of goto is used as a means to get out of a corner one coded oneself into, and is generally a symptom of code that could be refactored.
-
اولی
I'd argue, as many others would argue, that in all of these cases, the usage of goto is used as a means to get out of a corner one coded oneself into, and is generally a symptom of code that could be refactored.
آخر خلاصه دومی:
Hence, in both cases, the use of the goto statement can be justified from the viewpoint of the correctness proof in Hoare Logic.