Last active
December 14, 2015 01:08
-
-
Save klmr/5003412 to your computer and use it in GitHub Desktop.
A note on line-breaks and indentation in VB to maximise readability:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Single-line lambdas: | |
_myService.MyMethod(userId, profileId, | |
Sub(message As EventArgs) _eventAggregator.SendMessage(message)) | |
' Multi-line lambdas: align `Sub` and `End Sub`: | |
_myService.MyMethod(userId, profileId, Sub(message As EventArgs) | |
_eventAggregator.SendMessage(message) | |
_localVariable = e.Result | |
End Sub) | |
' … the IDE should do this automatically for you. | |
' Of course, this is quite a huge level of indentation, you can dedent the whole block: | |
_myService.MyMethod(userId, profileId, | |
Sub(message As EventArgs) | |
_eventAggregator.SendMessage(message) | |
_localVariable = e.Result | |
End Sub) | |
' (note the alignment to the opening parenthesis of the surrounding parameter list) | |
' … or even: | |
_myService.MyMethod(userId, profileId, | |
Sub(message As EventArgs) | |
_eventAggregator.SendMessage(message) | |
_localVariable = e.Result | |
End Sub) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment