Is it important to know about GOTOs?

  • (10 Pages)
  • +
  • « First
  • 7
  • 8
  • 9
  • 10

143 Replies - 6713 Views - Last Post: 13 October 2012 - 01:05 PM

#121 G0rman  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 6
  • View blog
  • Posts: 46
  • Joined: 16-October 11

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:05 PM

View Postno2pencil, on 14 October 2012 - 03:03 AM, said:

View PostG0rman, on 11 October 2012 - 09:43 AM, said:

GOTOs are considered "evil", but does that mean they should be forbidden knowledge?

GOTO is not efficient in functional coding. If I were paying for school, I wouldn't want them teaching me bs that isn't going to help further my career.

There is nothing wrong with proactively learning outside of the box. But if you are not going to use GOTO in a script or 8 bit computing, you are wasting your time.

Interesting, so what do you think about learning historical components of computing? For example old language no longer in active use, FORTRAN for instance.



^ See guys, it is possible to respond to a thread without claiming anyone who disagrees with you is an idiot/is inexperienced/is studying an illegitimate degree/is a liar/etc. Heck, he even disagreed with OP without doing any of that!
Was This Post Helpful? -1
  • +
  • -

#122 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7644
  • View blog
  • Posts: 12,896
  • Joined: 19-March 11

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:06 PM

View PostG0rman, on 13 October 2012 - 02:01 PM, said:

View Postjon.kiparsky, on 14 October 2012 - 02:51 AM, said:

This is a pure waste of time.

> Write me some code using gotos
> Validate the code
> Now you are fired for writing a validator for code with gotos instead of writing in Java

Scumbag boss.


The boss is there to run the company. The company has to make money. You sitting around making mud pies does not make money for the company. If you did what you're advocating, and he didn't fire you, he'd be an idiot.
Was This Post Helpful? 0
  • +
  • -

#123 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10468
  • View blog
  • Posts: 38,799
  • Joined: 27-December 08

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:07 PM

Let me be very direct then- if gotos are so powerful and useful, why is it a good idea to write code that will require so much extra effort and be more error-prone when I can write code to do the same thing without all the extra checks and risk?

I understand the arguments and have read the thread. I think this is the point everyone else is trying to get you to address. If this cannot be justified, I don't think you really have an argument here, besides that we use it where we absolutely have to (legacy languages and assembly).
Was This Post Helpful? 1
  • +
  • -

#124 G0rman  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 6
  • View blog
  • Posts: 46
  • Joined: 16-October 11

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:07 PM

View Postjon.kiparsky, on 14 October 2012 - 03:03 AM, said:

The request you're referring to specifically asked for an example of "something I'd actually want to do" that GOTO allows and existing control structures do not allow. Reinventing these wheels is not something that any sane person would want to do, and you've demonstrated quite thoroughly just why that is. Thank you. Are we done yet?

That isn't what you said.

You said "If you haven't got an example of this power and flexibility - and I'm honestly interested in seeing it - I think there's not much point in continuing with this."

What better way to show power and flexibility than to show that goto can perform the same tasks as if/then/else, for loops, while loops, do while loops, and functions?

Why are you suddenly changing what you were asking now?



Didn't I already reply to what you said?
Something like;
"I can't show you something you'd want to do with gotos, because 1. Confirmation bias, and 2. anything you can do with gotos you can do with if/then/else, loops, sub, etc"

This post has been edited by G0rman: 13 October 2012 - 12:09 PM

Was This Post Helpful? 0
  • +
  • -

#125 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5247
  • View blog
  • Posts: 27,069
  • Joined: 10-May 07

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:09 PM

View PostG0rman, on 13 October 2012 - 03:05 PM, said:

Interesting, so what do you think about learning historical components of computing?

I believe it doesn't belong in a standard college course.

& any language that begins with 'V' is not historical, imo.
Was This Post Helpful? 0
  • +
  • -

#126 ccubed  Icon User is offline

  • It's That Guy
  • member icon

Reputation: 160
  • View blog
  • Posts: 1,403
  • Joined: 13-June 08

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:10 PM

View PostG0rman, on 13 October 2012 - 12:40 PM, said:

View Postjon.kiparsky, on 14 October 2012 - 02:35 AM, said:

Quote

My argument was that if your philosophy is "don't do anything that won't be in the final product" then wouldn't that imply that you won't use testing, source control and IDEs, etc.


But since nobody advocated that philosophy, you're wasting your breath.

But you did? :/

Not in those exact words, but read your posts again. It's pretty clear that you are saying you don't bother writing automations and scripts that won't be in the final deliverable.

eg "I could write a bash script to find this, but then you've got me once again spending my time and attention on things which are not important to me"

Besides that, how is "but no one said that" a defence for a blatant strawman?


I think this will be my last post. It is painfully clear that you're wanting someone to tell you that goto is a good way to program and no one is going to. No one has an issue with your degree, if you say it's CS and they taught multiple languages that's fine, the UK may have different standards, but when you list that many and talk about learning libraries and IDEs that is going to cause someone to raise an eyebrow and ask you if it was really CS. That sounds more like a development course. Even if we get past that, a lot of your responses have been contradictory to basic concepts of computer science.

View PostG0rman, on 13 October 2012 - 11:11 AM, said:

Oh ok, I must be confused, because our CS degree teaches us programming as well as computational and numerical theory.

So CS majors in US can't program? That seems kind of funny to me :P
Oh well, I guess our degree just goes above and beyond, since they teach us the basics of so many languages in addition to everything that you "expect" a CS major to know.

Kind of ironic that a Computer Science major in the US apparently doesn't use a computer! Well I guess there are all kinds of places in the world!


I'll admit, I was being condescending and I apologized for it because I couldn't think of a better way to word it. This was just sarcastic and underhanded however.

View PostG0rman, on 13 October 2012 - 11:11 AM, said:

> What is one way function? HAHA I TRICK YOU THERE ARE NONE
As far as I know, modular calculus is entirely one way. And until someone proves P=NP, it's going to stay that way.


It's called a conjectured one-way function. It is not officially a one-way function because those haven't officially been proven to exist and if they did it would mean P != NP. So I'm not sure what P=NP has to do with anything.

View PostG0rman, on 13 October 2012 - 12:40 PM, said:

foo(int i) {
if(i==10) goto ten;
return "not ten"
ten: ;
return "ten"
}


Scope? This has no Scope except global or the function block it resides in. That's part of the problem and if you can't understand that then you don't understand Scope.

View PostG0rman, on 13 October 2012 - 12:40 PM, said:

> we don't need tests because you will never do anything wrong
> if you learnt CS you would know this

Yeah sorry mate, I guess that's where our degrees diverge again. The degree I took taught that you should include testing, and that programmers do make mistakes often and you should write code and tests to try and prevent this.


That's not what I said at all. I said in your particular example it doesn't need a separate script to run through and tell you how much memory your program is using on average. Can you not tell me how much memory the following structure takes up without a script? (Assuming 32 Bit)

Structure Foo{
   int x;
   std::string name;
   double y;
}



View PostG0rman, on 13 October 2012 - 12:40 PM, said:

> there are only 2 levels of abstraction
> ASM, and "modern programming"

What? What about hardware below ASM, or system architecture above "modern programming"? ASM and "modern programming" are not the only 2 levels of abstraction.


That is not what I said at all.

View PostG0rman, on 13 October 2012 - 12:40 PM, said:

When you plan out a system, do you do it straight in C? You don't draw any diagrams or anything?


Typically no. I write up the structures and classes I want. See if I can cut down on any and then get to coding. I've never had any problem with optimization. In fact, I live to make code as short as possible. I don't expect everyone to code this way, I happen to have a really good memory so I can do it this way. So that's not important.

View PostG0rman, on 13 October 2012 - 12:40 PM, said:

> 'I know better than you and I'm telling you NO'
What does "universality' even mean? I have never in my life heard that term. Gotos are /too/ universal?


It means that anyone should be able to read your code. It means making that possible by following the same standards as everyone else. We have a problem with that. The one thing we don't have a problem with is people using goto. Or shouldn't.

View PostG0rman, on 13 October 2012 - 12:40 PM, said:

> 'the reason is scope'
Did you mean to say structure?


No, I meant to say Scope.

All in all, it sounds like you have no intention of listening. You want someone to reaffirm your beliefs, I won't. I don't think anyone else will as apparent by this thread. So i'm out.
Was This Post Helpful? 1
  • +
  • -

#127 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10468
  • View blog
  • Posts: 38,799
  • Joined: 27-December 08

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:11 PM

Quote

Didn't I already reply to what you said?
Something like;
"I can't show you something you'd want to do with gotos, because 1. Confirmation bias, and 2. anything you can do with gotos you can do with if/then/else, loops, sub, etc"

Then at this point, what is the point in continuing to advocate for people to use an outdated programming practice? For the sake of being passionate about it? Just because something exists doesn't mean that we have to or should use it.
Was This Post Helpful? 0
  • +
  • -

#128 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7644
  • View blog
  • Posts: 12,896
  • Joined: 19-March 11

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:12 PM

View PostG0rman, on 13 October 2012 - 02:07 PM, said:

View Postjon.kiparsky, on 14 October 2012 - 03:03 AM, said:

The request you're referring to specifically asked for an example of "something I'd actually want to do" that GOTO allows and existing control structures do not allow. Reinventing these wheels is not something that any sane person would want to do, and you've demonstrated quite thoroughly just why that is. Thank you. Are we done yet?

That isn't what you said.

You said "If you haven't got an example of this power and flexibility - and I'm honestly interested in seeing it - I think there's not much point in continuing with this."

What better way to show power and flexibility than to show that goto can perform the same tasks as if/then/else, for loops, while loops, do while loops, and functions?

Why are you suddenly changing what you were asking now?



Didn't I already reply to what you said?
Something like;
"I can't show you something you'd want to do with gotos, because 1. Confirmation bias, and 2. anything you can do with gotos you can do with if/then/else, loops, sub, etc"



I think at this point you can just go back and start reading from page one. There's been nothing new raised here in quite a while, and everything you've raised has been answered. If you've convinced anyone of anything, congratulations. If you have anything new to bring up, feel free, but in the interests of DRY, if I don't respond you can assume I've said it already.
Was This Post Helpful? 3
  • +
  • -

#129 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5247
  • View blog
  • Posts: 27,069
  • Joined: 10-May 07

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:13 PM

View Postmacosxnerd101, on 13 October 2012 - 03:11 PM, said:

Then at this point, what is the point in continuing to advocate for people to use an outdated programming practice?

Because the op is a student, & doesn't yet grasp real world experience. Thus he op is dead set to inform those that do know, that the programming world as the op understands it should be a certain way, rather than the way it is.

This topic comes up like 2 or 3 times per year. & in each case the op walks away hurt because they really just don't have a good enough grasp on programming yet to be able to listen to reasons why GOTO is a useless technology.

If one is using GOTO in a modern language, then they either didn't set up their conditional statement correctly, or they don't understand logic.
Was This Post Helpful? 2
  • +
  • -

#130 G0rman  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 6
  • View blog
  • Posts: 46
  • Joined: 16-October 11

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:18 PM

View Postmacosxnerd101, on 14 October 2012 - 03:07 AM, said:

Let me be very direct then- if gotos are so powerful and useful, why is it a good idea to write code that will require so much extra effort and be more error-prone when I can write code to do the same thing without all the extra checks and risk?

jon.kiprasky asked me to, so I did it.

Honestly if you did read the thread you will see him asking, and me quoting him and replying with the code. It should be blatantly obvious why I wrote it.

View Postmacosxnerd101, on 14 October 2012 - 03:07 AM, said:

I understand the arguments and have read the thread. I think this is the point everyone else is trying to get you to address. If this cannot be justified, I don't think you really have an argument here, besides that we use it where we absolutely have to (legacy languages and assembly).

If you understand the thread why have you been saying such ridiculously out of context things? Please take things a little more seriously instead of joking around like that.

View Postjon.kiparsky, on 14 October 2012 - 03:06 AM, said:

View PostG0rman, on 13 October 2012 - 02:01 PM, said:

View Postjon.kiparsky, on 14 October 2012 - 02:51 AM, said:

This is a pure waste of time.

> Write me some code using gotos
> Validate the code
> Now you are fired for writing a validator for code with gotos instead of writing in Java

Scumbag boss.


The boss is there to run the company. The company has to make money. You sitting around making mud pies does not make money for the company. If you did what you're advocating, and he didn't fire you, he'd be an idiot.

> Fired for doing what the boss said once he realize he won't make any money from it

Enjoy your lawsuit buddy.

Does US have unfair dismissal law? (or something to that effect).


- WAIT, why the hell are we even discussing law? If your boss fires you for doing something you ask him to do, then he is definitely a scumbag.
But besides that, what has this got to do with goto...

View Postno2pencil, on 14 October 2012 - 03:13 AM, said:

Because the op is a student, & doesn't yet grasp real world experience. Thus he op is dead set to inform those that do know, that the programming world as the op understands it should be a certain way, rather than the way it is.

View Postmacosxnerd101, on 14 October 2012 - 03:11 AM, said:

Then at this point, what is the point in continuing to advocate for people to use an outdated programming practice? For the sake of being passionate about it? Just because something exists doesn't mean that we have to or should use it.

Please re-read thread and quote when I advocate using goto instead of structured programming elements.

Otherwise quit the straw-manning. Just because I don't think gotos are inherently evil and will corrupt anything they touch, "destroying the scope" and causing the apocalypse and whatnot, doesn't mean I advocate using them.

If I say "hand drills are ok" doesn't mean I am telling people to sell their electric drills and buy hand drills.

Do you understand the difference?


View Postjon.kiparsky, on 14 October 2012 - 03:12 AM, said:

I think at this point you can just go back and start reading from page one. There's been nothing new raised here in quite a while, and everything you've raised has been answered. If you've convinced anyone of anything, congratulations. If you have anything new to bring up, feel free, but in the interests of DRY, if I don't respond you can assume I've said it already.

Why on earth did you ask the same question twice, then when I reply say "you need to reread the thread"?

If you are back to asking the same questions, then isn't it because /you/ need to reread the thread?

This post has been edited by G0rman: 13 October 2012 - 12:20 PM

Was This Post Helpful? 0
  • +
  • -

#131 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10468
  • View blog
  • Posts: 38,799
  • Joined: 27-December 08

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:18 PM

Quote

jon.kiprasky asked me to, so I did it.

Honestly if you did read the thread you will see him asking, and me quoting him and replying with the code. It should be blatantly obvious why I wrote it.

You attempted to do so. I think it's fair to say your examples and points have a lot of logical fallacies that have been presented to death in this thread.

Quote

If you understand the thread why have you been saying such ridiculously out of context things? Please take things a little more seriously instead of joking around like that.

I'm neither joking nor taking things out of context. Just because I understand what is going on doesn't then imply that I agree with you. Contrapositively, if I don't agree with you, that doesn't mean I don't understand things.

Quote

If I say "hand drills are ok" doesn't mean I am telling people to sell their electric drills and buy hand drills.

Drawing a comparison to gotos, they are more like the cars from the Flintstones. Why would you use those on an interstate nowadays when you could drive an Accord instead?
Was This Post Helpful? 1
  • +
  • -

#132 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5247
  • View blog
  • Posts: 27,069
  • Joined: 10-May 07

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:20 PM

View PostG0rman, on 13 October 2012 - 03:18 PM, said:

Do you understand the difference?

Come back & argue this more when you have a paying job from an employer as a programmer.
Was This Post Helpful? 3
  • +
  • -

#133 G0rman  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 6
  • View blog
  • Posts: 46
  • Joined: 16-October 11

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:27 PM

View Postmacosxnerd101, on 14 October 2012 - 03:18 AM, said:

You attempted to do so. I think it's fair to say your examples and points have a lot of logical fallacies that have been presented to death in this thread.

Are you saying I attempted but failed to write code? I'm pretty sure I wrote code, you can go back and check if you really want to.

> talks only in vague generalities
How do you expect people to take something like that seriously?

View Postmacosxnerd101, on 14 October 2012 - 03:18 AM, said:

I'm neither joking nor taking things out of context. Just because I understand what is going on doesn't then imply that I agree with you. Contrapositively, if I don't agree with you, that doesn't mean I don't understand things.

Really? Because previously you said I should use JUnit to test code that uses gotos.

Do you not understand just how stupid that is? In Java goto is a reserved word, but it doesn't do anything. So obviously my code wasn't Java. Secondly I am 99% sure that JUnit does not test for the aforementioned ad-hoc goto-emulation of functions.

So why on earth would you even say something so stupid, if not because you were confused?

Do you see why I thought you were joking?

View Postmacosxnerd101, on 14 October 2012 - 03:18 AM, said:

Drawing a comparison to gotos, they are more like the cars from the Flintstones. Why would you use those on an interstate nowadays when you could drive an Accord instead?

Luckily I'm not telling anyone to go around driving Flintstones' cars, nor am I telling people to use gotos.
So there's no problem.

Are you telling me that Flintstones' cars are the work of the devil?

View Postno2pencil, on 14 October 2012 - 03:20 AM, said:

View PostG0rman, on 13 October 2012 - 03:18 PM, said:

Do you understand the difference?

Come back & argue this more when you have a paying job from an employer as a programmer.

Why are you being such an asshole?

I've had a few paying jobs from an employer as a programmer. (As opposed to paying jobs not from an employer as a programmer)

inb4"durr I bet you were you fired for using goto"

EDIT: Wow have your only posts so far been "op is a dumb student" and "get a job op"? Way to contribute. That's even worse than the guy who decided to post a LISP history lesson then conclude with "because LISP does it, so should you". At least he had good intentions.

This post has been edited by G0rman: 13 October 2012 - 12:28 PM

Was This Post Helpful? -1
  • +
  • -

#134 SpectateSwamp  Icon User is offline

  • D.I.C Head

Reputation: 51
  • View blog
  • Posts: 243
  • Joined: 31-December 07

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:34 PM

*
POPULAR

Goto's are the greatest. I just love them.

The greatest program on the planet has well over 200 goto's. And I am adding them all the time.

My most recent feature is to randomly play video along with the associated large font text explaining the clip. The program is a monster and very spaghetti like. Rather than try and figure out where the logic has to skip to. I put in a goto and test it; then another and another and presto the puppy is working better than expected. If you like jamming code like I do, then you have to use goto's
Was This Post Helpful? 5
  • +
  • -

#135 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10468
  • View blog
  • Posts: 38,799
  • Joined: 27-December 08

Re: Is it important to know about GOTOs?

Posted 13 October 2012 - 12:35 PM

Quote

Are you saying I attempted but failed to write code? I'm pretty sure I wrote code, you can go back and check if you really want to.

No, I said you didn't make compelling arguments for the case of using gotos. Clearly you say now that you aren't advocating the use of gotos, nor is anyone else here. Clearly we both agree there are better ways of doing things here. I'm confused on what the discussion is or what the argument is.

Quote

Really? Because previously you said I should use JUnit to test code that uses gotos.

Now who is accusing whom of taking things out of context? I said there are plenty of frameworks to test code. I did not specify what type of code, or even if it had to use gotos. I used JUnit as an example for Java. You didn't like that because Java doesn't use gotos, so I presented two comparable frameworks for C, which allows the use of gotos.

Quote

> talks only in vague generalities
How do you expect people to take something like that seriously?

Not really. I even pull your quotes with pretty clear context, and I get shut down for pulling things out of context. So regardless of whether or not I cite what you say, I'm going to get shut down.
Was This Post Helpful? 0
  • +
  • -

  • (10 Pages)
  • +
  • « First
  • 7
  • 8
  • 9
  • 10