All syntax guides
Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.
3,965 guides across 14 topics
Topics
Popular guides
Most readLatest guides
Page 356 of 397C# throw vs throw ex: Stack Trace Differences Explained
c# throw vs throw ex: Understand the difference between throw and throw ex in C#, how each affects the stack trace, and when to use which for reliable error handling.
C# Throw Exception: Syntax and Correct Usage
Learn how to throw exceptions in C#, including correct syntax, custom exception types, rethrowing, and common pitfalls.
C# Throw Keyword: Syntax, Rethrowing, and Filters
Practical guide to the C# throw keyword: syntax, rethrowing exceptions, exception filters, custom exceptions, and performance tradeoffs.
C# Finally Block: Execution Guarantees and Usage
Learn how the C# finally block guarantees cleanup runs, how it interacts with return and exceptions, and when it does not execute.
C# Try Catch Finally: How the Blocks Actually Behave
Understand how try, catch, and finally blocks interact in C#, when the finally block runs, and how to avoid common exception-handling mistakes.
C# try catch: Syntax, Usage, and Pitfalls
c# try catch: Learn the practical syntax and behavior of the C# try-catch statement, including exception filters, finally, performance implications, and common mistakes.
C# Exception Handling: Patterns for Robust Code
Practical C# exception handling patterns: try-catch-finally, exception filters, custom exceptions, performance tradeoffs, async code, and result types.
C# Generic In vs Out: Covariance and Contravariance
Understand C# generics `in` vs `out`: covariance and contravariance, when to use each keyword, and how the compiler enforces these rules.
C# Generic Contravariance: How It Works
Learn how C# generic contravariance lets base-type implementations work with derived types, including practical interface and delegate examples.
C# Generic Covariance: How It Works and Where to Use It
Understand C# generic covariance with practical examples, including how the out keyword enables safe type substitution in interfaces and delegates.