Lets Talk - Always use the as operator - No Thank you @Matlus
Lets Talk - Always use the as operator - No Thank you  @Matlus
Uploaded January 2021 | Updated September 2026, 1 week ago
The Standard guidance is to use the "as" operator anytime we need to do a cast, because it is safer (doesn't throw and exception). But it is wise to give up security for safety? Maybe the "as" operator gives us a false sense of security. Maybe, we should be using the cast expression almost always unless we don't know for sure if a certain type can be cast to the required type? Using the cast expression certainly expresses our intent clearly.

In this video, I make a case for why we should be using the cast expression in many cases where most folks will use the "as" operator, making our code more robust and less buggy.

Some of the code shown in this video comes from this project:
github.com/matlus/MovieServiceYouTube
Lets Talk - Always use the as operator - No Thank youSo You Want To Be A Code Reviewer? #5 Part 1 - Method DesignIntroduction To NoSQL DatabasesgRPC - Real-World .NET Core/.NET 5 ApplicationsDebate: Dependency Injection - Love it or Hate itCustom Data Structure: A  One To Many MappingWinJS - PromisesFireside Chat SeriesDelegates and Higher Order FunctionsDatabase Sharding - Scaling Relational DatabasesAbstraction in Software DesignSo You Want To Be A Code Reviewer? #5 Part 2 - Method Design
Shiv Kumar |

Let's Talk - Always use the "as" operator - No Thank you

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER