Jump to content

A Reminder About Variable Aliases (DIMs)

Random Terrain

Recommended Posts

If you think you'll ever want anyone to help with your code, be sure to have an alias for every variable that is used in your program (using dim). Your aliases should be near the beginning of your code (so they will be easy to find) and the list should be in alphabetical order (so it will be easy to see how many variables are free to use).



dim _Broomstick = a
dim _Flying_Monkey = b
dim _Auntie_Em = c
dim _Scarecrow_Dance = d

When every variable has an alias and all aliases are near the beginning of your program in an alphabetical list, you (and anyone else that might have to read your code) will be able to easily see the variables you are using and which variables are free to use. Please do not sprinkle DIMs throughout your code. Keep them all together in an alphabetical list near the beginning of your program.

Speaking of aliases, I put one underscore in front of variable aliases and two underscores in front of labels. Then I don't have to worry if I'm using a bB keyword by mistake and I'll never have to worry if a label has the same name as a variable alias.
  • Like 6
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...