C# Tips and Traps
Sometimes it's hard to know what you don't know. Short-circuit your learning of C# and level-up your code with this collection of C# and .NET features.
What you'll learn
There are so many features of C# and .NET that are underutilized or unknown that can make solving problems easier. In this course, C# Tips and Traps, you will gain the ability to more easily implement C# solutions. First, you will learn string, number, date, and object tips. Next, you will discover tips related to file paths and URIs, in addition to tips related to structuring and compiling classes and code. Finally, you will explore how to cast and convert types, and also how to get and control information about the runtime environment. When you are finished with this course, you will have the skills and knowledge of C# needed to develop effective C# applications with less code.
Table of contents
- Version Check 0m
- Introduction 2m
- Simplifying String Empty and Null Checking Code 4m
- Testing Char Unicode Validity 3m
- String Formatting and String Interpolation 4m
- Formatting and Aligning Values into Columns 3m
- Conditional Formatting for Positive, Negative, and Zero Numbers 3m
- Building Strings with the StringBuilder Class 4m
- Creating and Using Custom Numeric Format Providers 4m
- Summary 1m
- Introduction 1m
- Parsing Strings into Numbers with the NumberStyles Enumeration 6m
- Preventing Ambiguous DateTime Parsing and Mis-parsing 3m
- Parsing DateTimes with the DateTimeStyles Enumeration 4m
- Representing Arbitrarily Large Integer Values 3m
- Creating Random Numbers 7m
- Creating Cryptographically Secure Random Numbers 2m
- Generating Sequences of Integer Values 3m
- Summary 1m
- Introduction 1m
- The Danger of Virtual Method Calls from Constructors 3m
- Simplifying Constructor Overloads 3m
- Creating Methods That Take an Arbitrary Number of Arguments 4m
- Using Indexers in Your Own Classes 3m
- Partial Classes and Partial Methods 4m
- Simplifying Code with Local Functions 2m
- Creating Type Namespace Aliases 2m
- Using Keywords for Variable Names and Parameters 1m
- Exiting Loops Early 1m
- Summary 1m
- Introduction 1m
- An Overview of C# Preprocessor Directives 2m
- Implementing Conditional Compilation with Preprocessor Directives 4m
- Conditionally Compiling Code for Different Platforms 5m
- Defining Custom C# Compilation Symbols 3m
- Emitting Custom C# Compiler Warnings and Errors 3m
- Conditionally Calling a Method Based on Compilation Symbols 2m
- Unit Testing Internal Methods 2m
- Marking Code as Obsolete 2m
- Binary Compatibility and Optional Parameters 2m
- Summary 1m
- Introduction 1m
- Consequences of Exceptions in Static Constructors 3m
- Getting Environment Information in C# 3m
- Changing the Current Thread's Culture at Runtime 2m
- Deferring Creation of Resource-intensive Objects until First Use 6m
- Exception Caching with Lazy<T> 2m
- Creating Delays with Tasks 2m
- Launching Arbitrary Programs and Processes 4m
- Capturing Process Output and Errors 3m
- Summary 1m
- Introduction 1m
- Merging IEnumerable Sequences Together 7m
- Performing Set-based Operations on IEnumerable Sequences 4m
- The Caller Information Attributes 6m
- Non Short-circuiting Logical Operators in C# 5m
- Preserving Your Stack Trace When Rethrowing Exceptions 4m
- The Null-coalescing and Null-conditional C# Operators 5m
- Summary and Further Learning 2m