إنتقل إلى المحتوى الرئيسي

الفصل 2: توليد الشيفرة وتصحيح الأخطاء

قالب توليد الشيفرة​

Language: \{LANGUAGE\}
Framework: \{FRAMEWORK\} (if applicable)

Task: \{DESCRIPTION\}

Requirements:
- Input: \{INPUT_TYPES\}
- Output: \{OUTPUT_TYPE\}
- Edge cases: \{EDGE_CASES\}
- Performance: \{REQUIREMENTS\}

Include:
- Type hints/annotations
- Docstrings with examples
- Error handling
- Unit tests (optional)

Style: \{STYLE_GUIDE\}

موجّهات تصحيح الأخطاء​

Debug this \{LANGUAGE\} code:

```{language}
\{CODE\}

Error message: \{ERROR\} Expected behavior: {EXPECTED} Actual behavior: {ACTUAL}

Please:

  1. Identify the bug
  2. Explain why it occurs
  3. Provide the fixed code
  4. Suggest how to prevent similar bugs

## مراجعة الشيفرة

```text
Review this code for:
- [ ] Correctness/bugs
- [ ] Performance issues
- [ ] Security vulnerabilities
- [ ] Code style/readability
- [ ] Best practices

Format:
| Line | Issue | Severity | Suggestion |
|------|-------|----------|------------|

توليد الوثائق​

Generate documentation for this \{LANGUAGE\} \{TYPE\}:

```{language}
\{CODE\}

Include:

  • Description
  • Parameters (types, descriptions)
  • Return value
  • Usage examples (3)
  • Exceptions/errors

## النقاط الرئيسية

:::tip[ملخص]
1. حدد **اللغة، الإطار، دليل الأسلوب**
2. تضمين **أنواع المدخلات/المخرجات والحالات الحديّة**
3. طلب **تفسيرات** مع الشيفرة
4. استخدام **تنسيقات منظمة** للمراجعات
:::

---

**[← السابق: إنشاء المحتوى](/module_07/chapitre1-content-creation)** | **[التالي: تحليل البيانات →](/module_07/chapitre3-data-analysis)**