dotnet / dotnet/vblang

Lets stop Dimming non-arrays

Open
#388 12 comments 3 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

I've brought this up before I think, but I think it would be easy and useful for new VB users and converts from other languages to accept VB if this one keyword (Dim) could be avoided.
```
Let s As String = "A" ' Let reads better when a variable is not an array
Var p As Point ' Var reads better when you don't have an initial value to assign
Dim a(0 to 9) As Byte ' And this still reads OK for arrays
```
One argument is that we might want Let to be used for immutability, but I don't think that's a good idea, because it's not readable. Better would be to allow ReadOnly modifier for variables.
```
Let ReadOnly x = Fetch("stuff")
ReadOnly Var y = Load("stuff")
ReadOnly y = Load("stuff") ' Could leave off Let and Var because it reads fine without.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.