Briefle words · Code & architecture
Single responsibility principle
The idea that each module, class or function should have one clear job, and therefore only one reason to change.
Say it to an AI
Python book_appointment(patient, slot_id, db, mailer) that stays a short orchestrator of four calls: find_open_slot, check_guardian_consent, reserve_slot, send_confirmation. Follow the single responsibility principle: each helper does one job (validation, persistence, messaging) so it can be tested alone.
How an expert would brief the stronger version of “Appointment booking”.
See it
Try it as a puzzle →The backend code that books a patient into a free slot at a health clinic and confirms by email.
Why: In B, 'send_confirmation' only formats and sends the message; in A, changing the email wording means editing the same function that writes to the database.
Related words
Room 1 · Essentials
Learn “Single responsibility principle” in a five-minute lesson