One of the raps that VB sometimes gets is that we’re too “verbose.” There are a few things that we think might contribute to this perception that we’re looking at for the future, but I had an interesting flash the other day. I wonder how much the fact that we uppercase our keywords affects our perception? So I built a bootleg of the compiler and tried it out on some code of mine. Before:
Private Function ParseSimpleNameExpression() As SimpleNameExpression Dim start As Token = Peek() Dim name As SimpleName = ParseSimpleName(False) Dim typeArguments As TypeArgumentCollection = Nothing If Peek().Type = TokenType.LeftParenthesis Then Dim leftParenthesis As Token = Read() If Peek().Type = TokenType.Of Then typeArguments = ParseTypeArguments(leftParenthesis, False) Else Backtrack(leftParenthesis) End If End If Return New SimpleNameExpression(name, typeArguments, SpanFrom(start)) End Function
After:
private function ParseSimpleNameExpression() as SimpleNameExpression dim start as Token = Peek() dim name as SimpleName = ParseSimpleName(false) dim typeArguments as TypeArgumentCollection = nothing if Peek().Type = TokenType.LeftParenthesis then dim leftParenthesis as Token = Read() if Peek().Type = TokenType.Of then typeArguments = ParseTypeArguments(leftParenthesis, false) else Backtrack(leftParenthesis) end if end if return new SimpleNameExpression(name, typeArguments, SpanFrom(start)) end function
It’s a little frightening how much just changing the casing of our keywords makes us suddenly look like C#, at least to my eyes. I’m curious what people think of the idea? Would you like to see us switch to lowercase keywords? Provide an option?
(My replies to this entry maybe a bit slow–I’m going to be on vacation for a little while, but something to think about while I’m gone…)