Manually computing the index of the last element in a TList descendant is less clear
and less terse than using TList.Last. The Last method is equivalent in
functionality, and it's inlined so there shouldn't be any performance difference.
Use TList.Last instead of indexing with Count - 1:
procedure PrintMostRecent(MyList: TList<Integer>); begin WriteLn(MyList[MyList.Count - 1]); end;
procedure PrintMostRecent(MyList: TList<Integer>); begin WriteLn(MyList.Last); end;