markjprice / cs12dotnet8

Repository for the Packt Publishing book titled "C# 12 and .NET 8 - Modern Cross-Platform Development Fundamentals" by Mark J. Price
564 stars 164 forks source link

Page 305 - 'named' #51

Closed rmantel23 closed 2 months ago

rmantel23 commented 2 months ago

It might just be me, but I don't understand the word 'named' in this sentence:

Although the code works, there is potential for mistakes because literally any type can be used for the key or value. If another developer used your variable named and expected all the items to be a certain type, they might cast them to that type and get exceptions because some values might be a different type. A lookup object with lots of items would also give poor performance.

markjprice commented 2 months ago

Thanks. I've added an errata for this here: https://github.com/markjprice/cs12dotnet8/blob/main/docs/errata/errata.md#page-305---working-with-non-generic-types