Backend development

Stage 1 · Lesson 5 of 10

Exceptions and nullable types

Your language and how HTTP works

C# signals failure with exceptions. Throw a specific type, catch only what you can handle, and use using statements so connections and files are closed even on error. Create your own exceptions for business errors, such as OrderNotFoundException.

can later turn those into a in one place. are the other half of this topic. Put <Nullable>enable</Nullable> in the project file.

Then string means "never null" and string? means "maybe null". The compiler warns you when you use something that might be null. Treat those warnings as errors.

Common trapsilencing them with the ! operator everywhere, which removes the safety net and brings back the NullReferenceException it was meant to prevent.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with

  • GuideFree
    Learn C#

    Microsoft · Beginner

    Official C# tutorials from the language basics through classes, LINQ and async

Practise

  • Your language track: small exercises with free mentor feedback on idiomatic code

Keep handy

  • Quick syntax lookups for your language when you forget how something is written

  • Read the HTTP overview, methods, headers and status code pages until they feel obvious

Also worth your time

Mark this stage as not done?