views:

3623

answers:

10

What does DIM stand for in Visual Basic?

A: 

Declares and allocates storage space for one or more variables

Dim Statement (Visual Basic)

SQLMenace
-1, doesn't answer the question at all
cdmckay
+5  A: 

Dimension a variable, basically you are telling the compiler that you are going to need a variable of this type at some point.

JoshBerke
+3  A: 

Variable declaration. Initially, it was short for "dimension", which is not a term that is used in programming (outside of this specific keyword) to any significant degree.

http://in.answers.yahoo.com/question/index?qid=20090310095555AANmiAZ

Shoban
Your arrays are dimensionless? How odd...
Karl E. Peterson
A: 
ivan_ivanovich_ivanoff
+17  A: 

Dim originally (in BASIC) stood for Dimension, as it was used to define the dimensions of an array.

(The original implementation of BASIC was Dartmouth BASIC, which descended from FORTRAN, where DIMENSION is spelled out.)

Nowadays, Dim is used to define any variable, not just arrays, so its meaning in not intuitive anymore.

Patrick McDonald
a little background might help. In early releases of basic the only variables that needed to be declared were arrays. The "Dim" keyword was used to set the dimensions of this array.
Chris Simpson
I heard, a long time ago, that it meant Declare IMediately. Any thoughts there.
Nick
We'd have to ask the original implementors of BASIC, but DIM for dimension just makes sense
Patrick McDonald
+6  A: 

It's short for Dimension, as it was originally used to specify the size of arrays.

Later on it came to be used to declare all kinds of variables, when the possibility to specify the type for variables was added.

Guffa
+2  A: 

It stands for Dimension, but is generally read as "Create Variable," or "Allocate Space for This."

Robert Harvey
+2  A: 

Back in the day DIM reserved memory for the array and when memory was limited you had to be careful how you used it. I once wrote (in 1981) a BASIC program on TRS-80 Model III with 48Kb RAM. It wouldn't run on a similar machine with 16Kb RAM until I decreased the array size by changing the DIM statement

Thornton
+1  A: 

I've found references about Dim meaning "Declare In Memory", the more relevante is this document form Oracle: http://download.oracle.com/docs/cd/B31104_02/books/VBLANG/VBLANGVBLangRef67.html , Against this, I've heard that if you do not declare the variables in memory where do you do it? May be "Declare in Module" is a good alternative.

In my opinion, "Declare In Memory" may be a mnemonic to learn how to use Dim. I see "Declare in Memory" as a better meaning as it describes what it does in current versions of the language, but probably not the proper meaning.

At the origins of Basic Dim was only used to declare arrays, also notice that ReDim resizes arrays. And that it was taken form FORTRAN as Patrick McDonald said in his answer.

Lastly, things means what people think things means, and the more common explanation for Dim is that it means Dimension, so let it mean Dimension.

Really, Does It Matter?

Theraot