DEV Community

Discussion on: Which mainstream programming language has the ugliest syntax?

Collapse
 
codemouse92 profile image
Jason C. McDonald

VB.net was my first language, and I have a special hatred of it. (What sort of lunatic thought Dim made even the SLIGHTEST bit of sense for initializing a variable???)

Collapse
 
anasik profile image
Anas Ismail Khan

HAHAHAHA That's literally the first thing all VB.net developers, who generally tend to hate VB.net, say.

Even I was like "Hey what's this Dim.. oh wait, that's a variable being declared."

Thread Thread
 
kspeakman profile image
Kasey Speakman

I believe Dim is short for dimension. Not sure why the syntax is so array-focused.

Thread Thread
 
dmfay profile image
Dian Fay

Technically a scalar value is just a special case where an array only has one dimension and one element... I remember it from QBasic in the 90s and apparently it goes back to Fortran.

Thread Thread
 
codemouse92 profile image
Jason C. McDonald • Edited

True point. Although. technically declaring a value is also called instantiation, but that doesn't make Instant a good keyword for declaring a variable. :-P

Thread Thread
 
tinsoldier6 profile image
Jason Gade

Dim goes back to VB's BASIC roots. You didn't have to declare most scalar variables, but you had to use 'Dim' to 'Dim'ension arrays.

In some dialects, strings were treated as scalars and didn't require declaration, but other dialects required you to 'Dim' them as arrays.

As was mentioned, it may even go further back to FORTRAN, but that's a bit before my time.

/grognard hat off.

Collapse
 
daniel15 profile image
Daniel Lo Nigro

Be glad ReDim Preserve isn't a thing any more :P

Collapse
 
cbordeman profile image
Chris Bordeman

DIM was short for dimension. In early BASIC forms, it was to declare an array by indicating its size. Later it was repurposed to do any sort of declaration.