Current version

v1.10.4 (stable)


Main page
Archived news
Plugin SDK
Knowledge base
Contact info
Other projects


Blog Archive

Ugly variable definition syntax

In some programming languages, you must declare a variable by use, with a specific type:

ItemList count;

In other languages, you can declare a variable which can hold any type:

var item = document.getElementById('myForm');

In yet other languages, variables can be implicitly declared on use:

logOutput = DoCommand("somestring")

And then... there's Visual Basic.

Dim output As OutputWindow = env.GetOutputWindow()

Yuuuuuck! How do people stand this??

I don't ordinarily write Visual Basic code, but dug in a little bit in order to write a macro to provide the missing BuildStartupProject command that VS2005 still lacks. I'm not opposed to BASIC, but this has got to be the ugliest syntax hack ever, considering that DIM stands for "dimension" (it was originally used to declare sized arrays).


This blog was originally open for comments when this entry was first posted, but was later closed and then removed due to spam and after a migration away from the original blog software. Unfortunately, it would have been a lot of work to reformat the comments to republish them. The author thanks everyone who posted comments and added to the discussion.