What does "Dim" mean in Basic?

Asked

Viewed 5,277 times

6

Okay, most programmers (I think most of them) of Basic (popular; Visual Basic compiler) know what the use of Dim, but I also think you don’t know what that word means...

Basic Keywords are so obvious (unlike C#), Using to use a value, Sub to declare a sub-method, Function for a function, SyncLock to close synchronization on an object, but finally what is Dim?

In other languages, such as C#, it is easy to put a var of varIable, in Python a def of define or definition. I found it on a website there that means Dimension, but, dimension? Is it really dimension or has something else?

3 answers

13


Briefly, it is a term that was originally created to declare the dimension of arrays and over time was used for other objects.

The oldest reference I know comes from BASIC where DIM means "Dimension".

It was used specifically to determine the dimension of an array.

Over time the use became more comprehensive and came to be used also for other types of variables. Therefore, the original meaning "Dimension", currently is not intuitive considering the purpose of use for declaration of various types and not only arrays.

There are attempts at new interpretations such as "declare in memory", due to the fact that, with the use of DIM in declarations, the object is allocated to a space in memory. But the original meaning is "Dimension", as quoted above.

  • 3

    And Resize is used to resize an array at runtime.

  • @Cantoni could be "Resize Dimension", or something like.

  • 1

    Surely that’s what @Cypherpotato. :-)

  • Possibly "resize".

6

The Dim has multiple meanings attributed to it, the most accepted and oldest being the Dimension.

Dimension

DIM - (abbreviation of Dimension) sets the size of arrays.

The original concept of Dim is an abbreviation for Dimension, since in the early days of Basic it was used only to define the dimension of arrays.

Today it is known that the Dim is used to declare any variable, so this concept no longer fits today, which led to other interpretations for Dim.

Declare In Memory/Module

DIM - (abbreviation of declare in memory/module)

There are sources who say that the Dim means Declare In Memory/Module. This reference is also widely cited, as it has been documented by Oracle.

2

Translated into Portuguese would be an instruction, imperative action of the verb dimensionar.

It would be something like: dimensione, DIM.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.