[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
not using goto considered harmful
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 20
Thread images: 4
File: arpY4nB_700b.jpg (109 KB, 700x1049) Image search: [Google]
arpY4nB_700b.jpg
109 KB, 700x1049
http://koblents.com/Ches/Links/Month-Mar-2013/20-Using-Goto-in-Linux-Kernel-Code/

I hope none of you are cargo-cultist goto haters
>>
goto creates spaghetti code
go code assembly if you like to use goto
>>
File: 1463116115068.png (197 KB, 450x338) Image search: [Google]
1463116115068.png
197 KB, 450x338
>>54543133
>go code assembly
If you program in anything besides assembly you are a faggot
>>
>>54543133
>muh cargo cult
Bad programmers use goto to create spaghetti code

Java removes goto because Java is designed for Pajeets

Same reason Java has checked exceptions

Problem is, this hasn't prevented Pajeets from creating bad code anyway
>>
>>54543154
why do you post rms?

rms is a functional faggot
>>
File: Stallman.jpg (694 KB, 1543x1200) Image search: [Google]
Stallman.jpg
694 KB, 1543x1200
>>54543174
That's why I posted him
>>
>>54543133
>this they told me in my CS101 class
>>
>global variables are bad
>uses the singleton pattern
>>
I want to melt that Crystal maiden
>>
File: 1463021281390.png (113 KB, 387x337) Image search: [Google]
1463021281390.png
113 KB, 387x337
My professor taught me to not use goto, break and global variables so I don't use them.
>>
>>54543479
break/continue are fantastic though
>>
>>54543435
I thought it was Jaina.
>>
>>54543479
Those that teach such things never give any good examples and explanations. They heard/read somewhere that it's "bad" before so they start parroting to their students the rest of their lives
>>
>>54543117
I would say go is something to avoid, but sometimes it's worth using.
>>
goto's are okay depending on from where they're placed.

However in most cases your logic is probably poorly implemented to not allow unwinding cleanly.
>>
>>54543479
Your professor's a retard
>>
>>54543539
>>54544318
>>54545241
Not him, but I actually had two teachers. One of them telling me to not use those, and another one telling me it was fine.
There's pros and cons, and once you have some skills, you can start to wonder whether it's good or not to use them.

The fact is that I went on a school to help some students on their projects. Few of them actually used break and continue statements.
Guess what ? Their code was a mess, overcomplicated, and created bugs everywhere. Some things that could be done with a while loop in 5 lines took them various for with break statements ending on a 100 lines of code.
So there's some legit concern on telling a student that goto, break, continue and global variables aren't a good thing.
>>
>>54543479
>CS ``education''
>>
>>54543435
She only dates OSX and Windows users with a job.

Freetards are untouchables in real life.
>>
>>54545384
>Their code was a mess, overcomplicated, and created bugs everywhere. Some things that could be done with a while loop in 5 lines took them various
I think that's mostly an issue with how good a coder a person is than break's fault. Maybe they only managed to complete their code with break statements and didn't know how to replace all of that with while loops.
Thread replies: 20
Thread images: 4

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.