From the course: Ten Tips for the C# Developer
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Discard feature - C# Tutorial
From the course: Ten Tips for the C# Developer
Discard feature
- [Instructor] We are looking at C# tips in this course. As a new C# programmer, you quickly learn that C# is a compiled language, and that means that you need to compile your code before you can work with it. So in Visual Studio, you would go to the Build menu and choose Build. This will do multiple steps including compile your code. In my case, I compiled successfully, but in the real world, of course, you will make mistakes in your C# syntax, and you'll get compiler errors, and you need to fix those before you can successfully compile your code. Another thing you learn as a novice C# programmer is that Visual Studio will make suggestions on when you can improve your code, like I'm seeing here on line 13. I've got this integer variable. I have assigned a value of 10 to that variable. And I'm not using that variable in my code, so the editor is telling me with this screen squiggle that this variable is assigned, but…
Contents
-
-
-
Avoid race condition with TryGetValue method1m 46s
-
(Locked)
Better switch statements with pattern matching6m 42s
-
(Locked)
Readable literals with the underscore4m 8s
-
(Locked)
Extract items from sequence with indices9m 8s
-
(Locked)
Discard feature5m 3s
-
(Locked)
Be more functional with the conditional operator2m 42s
-
(Locked)
Create a thread-safe immutable type5m 13s
-
(Locked)
Use the ImmutableList collection4m 14s
-
(Locked)
Show custom debugger information4m 49s
-
(Locked)
Work with nested collections and SelectMany2m 45s
-
-