dotnet / dotnet/vblang

Reduce the need for backtracking while typing

Open
#154 4 comments 0 reactions 1 assignee Claimed by @AnthonyDGreen View on GitHub
Scenario
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

There are situations in VB today where you're dotting through an API and you realize you run into a wall that requires backtracking. Examples include needing to perform a cast or needing to await a `Task`. It breaks the flow of typing/thinking. It can also create a situation where a lot of ceremony starts accruing on the left like multiple `CType` or `Await` keywords very far from what they relate to.

In English, sentences are most often structured in Subject-Verb-Object form. This usually fits in well with object-oriented syntax where the subject is the receiver, the verb is the method, and the arguments are the objects: `subject.Verb(object)`. But, there are also times where this order is warped by the way an API is designed (sometimes necessarily).

``` VB.NET
' For performance reasons this isn't an instance methods.
Dim upper As Char = Char.ToUpper(ch)
```

In some cases this can be mitigated through the use of extension methods. Extension methods take the less natural `Verb(subject, object)` form and arrange it ... fluently.

``` VB.NET
' An extension method makes this read subject-verb.
Dim upper As Char = ch.ToUpper()
```

A number of proposals have showed up lately that all seem to share a theme of their proponents trying to reduce or eliminate backtracking, either as their primary benefit or a significant secondary one such as #138, #116, and #59.

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.