ENع
الدرس 30 · Designing code

Modules and interfaces

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

A big program is easier to read, test and change when it is split into modules: files that each do one job. Follow a small notes program in Python as main.py imports notes.py, uses only its public functions, and never sees its hidden helper. Then unplug a file store and plug a database store into the same Storage interface: two lines of main.py change, notes.py does not change at all, and the output stays the same.

10 دقيقة10 خطوات5 أسئلةBeginner
شكل 30 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.