Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

GOTO Considered Harmful

Name: Anonymous 2014-06-07 13:54

[code]
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
goto fail;
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
goto fail;
.../[code]

Name: Anonymous 2014-06-07 13:56


if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
goto fail;
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
goto fail;
...

Name: Anonymous 2014-06-07 14:15

This could happened with everything, I am not a fan of goto but for fuck's sake

if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
throw exceptionFailFactoryFactory;
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
throw exceptionFailFactoryFactory;
throw exceptionFailFactoryFactory;
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
throw exceptionFailFactoryFactory;
/* throw a exception to the factory that creates factories that create failures */

this could be avoided by using auto-indenting, emacs and kate have that for cases like this
Now, can anybody tell me why the fuck do they put ``err ='' if they do not use it?

Name: Anonymous 2014-06-07 14:20

>>3
They used it in the fail: section I suppose.

Name: Anonymous 2014-06-07 14:58

>>3
replaces `goto' with `throw' (the same thing)

THIS COULD HAVE HAPPENED WITH ANY LANGUAGE CONTSTRUCT

lol

keep lying to yourself gotofag

Name: Anonymous 2014-06-07 15:50

>>5
who are you quoting?

Name: Anonymous 2014-06-07 16:31

>>5
EPIC /G/RO, SIMPLY EPIC xDDDDDDDD
Who are you quoting anyway?


if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
fail();
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
fail();
fail();
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
fail();

Name: Anonymous 2014-06-07 17:32

>>7
EPIC /G/RO, SIMPLY EPIC xDDDDDDDD

being this childish to hide the fact that you're wrong. When are you going to realize goto is bad and grow out of BASIC.

Name: Anonymous 2014-06-07 17:35

>>8
goto
back to /g/, shitstain

Name: Anonymous 2014-06-07 17:36

>>8
EPIC /G/RO, SIMPLY EPIC xDDDDDDDD UPBOAT ROFLEL XDD
Did you ignored the part where I said ``I am not a fan of goto but for fuck's sake''?

Name: Anonymous 2014-06-07 17:42

>>6-10
How about you pull that rake out of your ass and stop replying to shitposts with shitposts?

Name: Anonymous 2014-06-07 17:45

>>11
xD

Name: Anonymous 2014-06-07 18:49

hax my anus

Name: Anonymous 2014-06-07 18:53

anus:
hax();

goto anus;

Name: Anonymous 2014-06-08 4:12

On a slightly related note, is this harmful?

errlevel=0;
a=push1(data);
if(a != SUCCESS) {errlevel=-1; goto FAIL0};
a=push2(otherdata);
if(a != SUCCESS) {errlevel=-2; goto FAIL1};
a=do_something(data,otherdata);
if(a != SUCCESS) errlevel=-3;
pop2(otherdata);
FAIL1:
pop1(data);
FAIL0:
return errlevel;

Name: mission-critical applications 2014-06-08 12:43

>>15

This would not be high grade programming suitable for mission-critical applications. Our style conventions dictacate the following:

errlevel=0;
a=push1(data);
if(a != SUCCESS)

{ // Open brace A here

errlevel=-1;

a=push2(otherdata);
if(a != SUCCESS)

{ // Open brace B here

errlevel=-2;

a=do_something(data,otherdata);
if(a != SUCCESS)

{ // Open brace C here

errlevel=-3;

pop2(otherdata);

} // Close brace C here

pop1(data);

} // Close brace B here

return errlevel;


As you can see it's essential to name your brackets so they can be back referenced. This avoids 100% of programmer error.

Name: Anonymous 2014-06-08 12:54

I actualy semy-agree with >>16-nigger that putting the success into the if is a better idea
one reason for this is that you can avoid more than one or two return statements and it also saves you from goto nigger; errors that only subhumans do

Name: Anonymous 2014-06-08 15:07

>>17
shut up, nigger

Name: Anonymous 2014-06-08 15:08

Homework problem #456787654:

Write a program than transforms a goto-using C program into one that doesn't use it

Name: Anonymous 2014-06-08 15:25

Homework problem #456787655:

Write a program than transforms a non-goto-using C program into one that uses it

Name: Anonymous 2014-06-08 16:48

Homework problem #456787656:

Write a program than transforms a +-using brainfuck program into one that doesn't use it

Name: Alexander Dubček 2014-06-09 5:44

11 PRINT "CHECK MY DOUBLES"
22 GOTO 11

Name: Anonymous 2014-06-09 11:42

Homework problem #456787656:

Write a Doubles Basic interpreter where code is doubles and the only expressible programs are programs that check doubles.

Name: Anonymous 2014-06-09 13:48

>>23
Goto will be renamed to check then

Name: Anonymous 2014-06-09 15:24

>>23
but that's undecidable!

Name: Anonymous 2014-06-09 16:04

That's not the issue.

Name: Anonymous 2014-06-09 16:56

Please tell you Dijkstra to learn about Mach's Principle. Because the nature is dual: glass can be both half-full and half-empty, but Dijkstra sees GOTOs as a half-empty glass. That is typical of shortsighted and self-righteous persons.

Name: Anonymous 2014-06-09 20:53

>>27
Typical liberal idiot who thinks everything is the way he wants it to be.

Name: Anonymous 2014-06-10 4:04

>>28
Typical conservative idiot who thinks everything ought to be the way ey wants it to be.

Name: Anonymous 2014-06-12 6:00

ey
Typical liberal

Name: Anonymous 2016-07-20 2:43

thinking exception handling is a goto statement
lel

Don't change these.
Name: Email:
Entire Thread Thread List