Briefle
LearnGlossaryPricing

Briefle words · Code & architecture

Single level of abstraction

Also called SLAP

The guideline that every line in a function should work at the same level of detail, either big steps or small details, not a mix.

Say it to an AI

Python confirm_booking(booking) as a composed method at a single level of abstraction: validate, price_trip, charge_card, send_confirmation_email, then set status. Put the email rendering and sending in its own function using our template and mailer, no SMTP or HTML inline.

How an expert would brief the stronger version of “Confirm a booking”.

See it

Try it as a puzzle →

A travel-booking API confirms a multi-leg trip once the traveller pays.

Study A · the weaker one
Study B · the stronger one

Why: B's 'confirm_booking' is all big steps; A mixes 'charge_card(...)' with 'smtp.login(MAIL_USER, MAIL_PASS)'.

Related words

  • Single responsibility principle
  • Flag argument
  • Side effect
  • Parameter object
  • Long parameter list
  • Named arguments
  • Options object
  • Utils file

Room 3 · Functions & structure

Learn “Single level of abstraction” in a five-minute lesson

Start free
AI can build almost anything. The bottleneck is saying what you want.
WordsPricingTermsPrivacyRefundsContact
© 2026 Briefle