Viewing a single comment thread. View all comments

A_dudeist_Priest t1_iydg0si wrote

I am an old fart developer that learned on the old PET's, C64 and TI, the language I learned on, was BASIC\Waterloo BASIC (we are talking early 80's here), GOTO was a staple. I have watched languages go from a "wall of code", to the more structured OOP that we use today.

You brought up and interesting point that I had never thought of, when calling a Function\Subroutine, everything in the calling function is pushed onto the stack, then popped from the stack when returning from the called function, the GC would then "clean up" as you say. But I guess using a GOTO statement would not push and pop the stack, would/could this cause a modern application to have a memory leak, or cause the application to run out of process and/or Heap space?

A hint for beginner developers, be careful of recursive function calls (functions that call themselves) if done improperly, you get into a recursive loop and you will very quickly run out of stack space.

1

Nagisan t1_iydgn4p wrote

I would guess it could cause memory leak issues and such, but in all honesty I'm not much for low-level programming details beyond what I did through school and much prefer sticking around the web dev space these days....so I'm not entirely sure the full implications that GOTO would have on memory.

1