Backend development

Stage 1 · Lesson 3 of 10

Functions, classes and exceptions

Your language and how HTTP works

Next, learn to structure your code. Functions take positional arguments (by order) and keyword arguments (by name). You will see *args and **kwargs, which collect extra arguments, in almost every framework.

A class groups data with the behaviour that uses it. cut the boilerplate for simple records. are how Python signals that something failed.

Raise a specific type, and catch only what you can handle, using try and except. Use with blocks so files and connections close even when something fails. Define your own exceptions, such as OrderNotFound, for errors your will later turn into a .

Common trapa bare except: or except Exception: pass, which swallows real bugs, typos included. You are left with silent wrong behaviour instead of a traceback, the error report that shows where it failed.

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· follow one of these

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?