Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Structured Programming
#21
Quote:Sometimes, a GOTO comes handy to do an optimization

Wink

In other words, you can always find an structured solution, but sometimes GOTO is faster.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#22
Quote:long names for variables may even slow up the program.

Please explain, I don't understand.
roeten van Frenkel
Visit us at The Official S&F PROD. Homepage
Reply
#23
longer varibles means more chars in the porogram making it slightly bigger, and longer variable names lengthens the seach of the program if u have variables with similar names, wat ive done in the past is at the and of production, i use the change function in qb to change all variales to a - z using appropriate symbols, and if more are required, then i use aa - zz, etc. and the goto thing can help, like wat if u want to exit a sub(s) without completeing it, and exit the loop(s) without using an extra variable called like exitloop or something like that
Reply
#24
i was under the impression that varnames are changed during compilation to adresss therefore all varnames will be essentially the same size on compilation. I could be wrong though
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#25
be rite though, i nvr decomplied a qb program to see if it does change the variables to adresses along with removing comments ot remarks
Reply
#26
The way I solved the problem a long time ago of using text book style of long descriptive names for variables etc is to compromise by using short abbrevaited descriptions. Alternatively list very short variables along with their full descriptions at the start of the program

Gordon
Reply
#27
Axipher, have you tried compiling a program before and after you changed all the names of the variables and see if the resulting exes were different? My guess is that the exes are exactly the same, or you made a mistake while changing the names.
roeten van Frenkel
Visit us at The Official S&F PROD. Homepage
Reply
#28
i have tried yes and it does make a slight speed diference, of course my programs were small so bigger programs may be slightly different, its not really that much though, the most it affects for me is getting keyboard and mouse input, other then that it works pretty much the same
Reply
#29
Quote:
long names for variables may even slow up the program

Slow......up? :lol:

I think in general this is not just about GOTO but about having to "structure" every single line as much as possible, and this would often include unnecessary TYPE-like structures.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#30
aga, what was the biggest application you ever wrote and how long was the maintenance phase after you finished the application?
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)