Consider a very primitive programming environment where there are only global variables, no functions/procedures, and no control structures like if statements or loops. In order to write a program in such a system, you'd have to jump around in the code from one label to another using goto, modifying global variables as you go along. This becomes extremely hard to understand and maintain as a program gets bigger.
In general it's definitely helpful to have structured code with loops, conditionals, and named functions that have their own variable scope.
Thanks, you're right. That was definitely a brain lapse on my part! Indeed, I was thinking of old basic or perhaps some of the older machine languages as well.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Consider a very primitive programming environment where there are only global variables, no functions/procedures, and no
control structures like if statements orloops. In order to write a program in such a system, you'd have to jump around in the code from one label to another using goto, modifying global variables as you go along. This becomes extremely hard to understand and maintain as a program gets bigger.In general it's definitely helpful to have structured code with loops, conditionals, and named functions that have their own variable scope.
You're mostly describing assembly, or BASIC. BTW, you can't write programs without
if
-like statements. Even assembly has them.Thanks, you're right. That was definitely a brain lapse on my part! Indeed, I was thinking of old basic or perhaps some of the older machine languages as well.