=== Code examples

==== Noncompliant code example

[source,vbnet,diff-id=1,diff-type=noncompliant]
----
Function GetAt(data As List(Of Integer), index As Integer) As Integer
    Return data.ElementAt(index)
End Function
----

[source,vbnet,diff-id=2,diff-type=noncompliant]
----
Function GetFirst(data As List(Of Integer)) As Integer
    Return data.First()
End Function
----

[source,vbnet,diff-id=3,diff-type=noncompliant]
----
Function GetLast(data As List(Of Integer)) As Integer
    Return data.Last()
End Function
----

==== Compliant solution

[source,vbnet,diff-id=1,diff-type=compliant]
----
Function GetAt(data As List(Of Integer), index As Integer) As Integer
    Return data(index)
End Function
----

[source,vbnet,diff-id=2,diff-type=compliant]
----
Function GetFirst(data As List(Of Integer)) As Integer
    Return data(0)
End Function
----

[source,vbnet,diff-id=3,diff-type=compliant]
----
Function GetLast(data As List(Of Integer)) As Integer
    Return data(data.Count-1)
End Function
----