Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Structured Programming
#31
Quote: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

That is incorrect. At the end of compilation, all variables turn into memory address numbers. Longer variable names only slow down the program when you are using an interpreter.

You can exit a sub without using goto with the following command:
Code:
EXIT SUB
.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Reply
#32
o, then y did the 2 different times i compiled were different
Reply
#33
Quote:o, then y did the 2 different times i compiled were different
Your sentence does not translate to english, I'm sorry, but you simply can not talk properly.
Reply
#34
Quote:
axipher Wrote:o, then y did the 2 different times i compiled were different
Your sentence does not translate to english, I'm sorry, but you simply can not talk properly.
eat when not can old we to drive say not hippo?
[Image: freebasic.png]
Reply
#35
ya, that was prtty sloppy, let's try it again:

then how come when i complied the program in 2 different ways, the one with longer variable names was slighter slower, could it be that longer variables are turned into longer memory adresses???

tehre, that looks much better
Reply
#36
yeah longer variable names are known to take up more memory in qbasic. that's also the case with longer numbers. so keep that all short ( use variable names like x, y only ) and you are on the save side memory wise.
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#37
well like i said before, normally when i compile my programs, I use qb's change function and change all variable and sub names to something short like a - z, aa - zz, etc.
Reply
#38
Quote:well like i said before, normally when i compile my programs, I use qb's change function and change all variable and sub names to something short like a - z, aa - zz, etc.
Changing variable names can be very dangerous, especially since QB will not inform you about undefined variables. It just treats them as being initialized to zero.

Also, if your variables made any sense to you originally, like "counter" and "maximum", after changing the names to "c" and "m", they don't make sense to you nor anyone.

If you really compile your programs, like you said, then changing the variable names before compiling doesn't make any sense at all, since the size of the variable names will not affect anything in a complied program.
*****
Reply
#39
well Marzec said that longer variables make for longer memrory adresses, so changin them to shorter names makes sense, plus all my variables hav ither $ or % after them so it wuold be easy to change only that one variable, plus if somenoe does decide to decomiple the program to see the code and/or steel it, they would have a harder time figuring it out
Reply
#40
Quote:well Marzec said that longer variables make for longer memrory adresses, so changin them to shorter names makes sense, plus all my variables hav ither $ or % after them so it wuold be easy to change only that one variable, plus if somenoe does decide to decomiple the program to see the code and/or steel it, they would have a harder time figuring it out
No, Marzec said that they take up more memory, not longer memory addresses. But, that's only the case when running INTERPRETED QB programs.

The business of de-compiling your program has nothing whatsoever to do with the variable names that you used in your source code. These variable names will never be seen again.

There is no such thing as de-compiling (or dis-assembling) a program from the executable code and converting it back to the original source code. Re-engineering experts can take your executable code and convert it to source code in some chosen language with meaningless variable names like a,b,c; but it will never look like your original code. Also, all the "structured programming" efforts you had will be converted to goto's, because assembly language is not structured.
*****
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)