B1 Confusable-words 10 min read متوسط

If مقابل Else-if مقابل Elsif: ما الفرق؟

عندك أدوات منطقية أساسية: if بتبدأ الحكاية، و else if بتضيف خيارات تانية، أما elsif فهي مجرد اختصار لبعض اللغات.

Grammar Rule in 30 Seconds

Use 'if' to start a condition, 'else' for the alternative, and 'else if' for a second specific option.

  • Use 'if' for your first condition: 'If it rains, stay inside.' (max 20 words)
  • Use 'else' for everything else: 'If it's sunny, go out; else, stay home.'
  • Use 'else if' for a middle option: 'If it's hot, swim; else if it's cool, hike.'
Condition 1 (If) ➡️ Option A | Condition 2 (Else If) ➡️ Option B | No Condition (Else) ➡️ Option C

نظرة عامة

### Overview
في جوهرها، فهم الفروق بين if و else if و elsif في اللغة الإنجليزية (وخاصة في سياقات المنطق والبرمجة التي تداخلت مع لغة العصر) يعني إتقان ما نسميه المنطق الشرطي (Conditional Logic). هذا المفهوم الأساسي يسمح لنا بالتعبير عن القرارات والنتائج بناءً على شروط محددة. في لغتنا العربية اليومية، نحن نستخدم الجمل الشرطية طوال الوقت؛ ففي أي جلسة عائلية أو نقاش في المجلس، قد تقول: «إذا كان الجو جميلاً، سنجلس في الحديقة، وإلا إذا كان الجو بارداً، سنجلس في الداخل».
هذه الهيكلة تتيح لنا تواصلاً دقيقاً حول الاحتمالات والإجراءات الناتجة عنها.
على الرغم من أن مصطلحات مثل elsif أو elif مستعارة مباشرة من لغات البرمجة، إلا أنها تمثل نمطاً عالمياً للتفكير الإنساني: التحقق من شرط ما، وإذا لم يتحقق، ننتقل للتحقق من بديل آخر، وهكذا. المبدأ اللغوي والمنطقي هنا هو «التقييم المتسلسل» (Sequential Evaluation). أنت لا تفكر في كل الاحتمالات في نفس اللحظة؛ بل تعالجها واحداً تلو الآخر حتى تجد الشرط الصحيح.
بالنسبة للمتعلم العربي للغة الإنجليزية (خاصة في المستوى المتوسط B1)، فإن فهم هذه المصطلحات لا يقتصر فقط على من يدرسون التكنولوجيا، بل يمنحك مفردات قيمة لوصف التدفق المنطقي المعقد في الحياة اليومية ومكان العمل. في اللغة العربية، نستخدم أدوات الشرط مثل «إذا» و«لو» و«إن»، ونربط البدائل بـ «وإلا إذا» أو «أما إذا». في الإنجليزية، نستخدم if لتقديم الشرط الأساسي الأول، ثم else if (أو متغيراتها التقنية) للشروط اللاحقة التي لا يتم فحصها إلا إذا كانت الشروط السابقة خاطئة، وأخيراً نستخدم else (وإلا) كخيار أخير عندما لا يتحقق أي شرط سابق.
### How This Grammar Works
تخيل أنك تشرح لزميل جديد كيفية التعامل مع ضيوف في تجمع عائلي كبير (عزيمة). أنت لن تطلب منه أن يقدم نفس المشروب لكل شخص دون سؤال. بدلاً من ذلك، ستعطيه مجموعة من القواعد المرتبة حسب الأولوية.
هذا بالضبط هو كيف تعمل هياكل if و else if و else: إنها تخلق مساراً للقرارات متبادلة الاستبعاد (Mutually Exclusive)، حيث يتم تنفيذ إجراء واحد محدد فقط.
في البداية، تؤسس جملة if الشرط الأول. هذا هو الفحص الأساسي، والسؤال الأول في عملية اتخاذ القرار. على سبيل المثال: If the guest asks for Arabic coffee, pour it in a Dallah. (إذا طلب الضيف قهوة عربية، اسكبها في الدلة).
هذه الجملة تضع السيناريو المحتمل الأول. إذا كان هذا الشرط صحيحاً (True)، يتم تنفيذ الإجراء المرتبط به، ويتم تجاهل كل الشروط اللاحقة تماماً.
أما إذا كان الشرط الأول خاطئاً (False) - أي أن الضيف لم يطلب قهوة عربية - ينتقل النظام (أو عقلك) إلى الشرط التالي في السلسلة، والذي يُقدم عادةً بـ else if. هذه الجملة تقترح شرطاً بديلاً يتم تقييمه *فقط* إذا كانت جميع الشروط السابقة خاطئة. تأمل هذا المثال: Else if the guest asks for tea, serve it with mint. (وإلا إذا طلب الضيف شاياً، قدمه مع النعناع).
هنا، يتم التحقق من طلب الشاي *فقط* إذا لم يطلب الضيف قهوة. إذا كان شرط else if هذا صحيحاً، يتم تنفيذ الإجراء الخاص به، ومرة أخرى، يتم تجاوز أي شروط أخرى متبقية.
في اللغة العربية، نحن نستخدم «فاء السببية» أو ننتقل مباشرة إلى «جواب الشرط» بعد الأداة. الإنجليزية تعتمد بشكل كبير على ترتيب الكلمات (Word Order) والفاصلة (Comma) لتوضيح أين ينتهي الشرط ويبدأ الإجراء.
تستمر هذه العملية في السلسلة. كل else if تعمل كبوابة: لا تُفتح إلا إذا ظلت البوابات السابقة مغلقة. وأخيراً، إذا لم يتحقق أي من شروط if أو else if، فإن قسم else (الذي يعادل «وإلا» في العربية) يوفر إجراءً افتراضياً (Default Action).
لا يحتوي else على شرط للتحقق منه؛ بل ينفذ إجراءه ببساطة إذا استُنفدت جميع المسارات السابقة. مثلاً: Else, offer them water. (وإلا، قدم لهم الماء). هذا يضمن وجود مسار دائم للتعليمات، حتى لو لم يتم استيفاء أي شرط محدد.
### Formation Pattern
تكوين هياكل if و else if و elsif و elif يبدأ دائماً بجملة if أساسية، متبوعة بجملة أو أكثر من else if، وتُختتم اختيارياً بجملة else النهائية.
من المهم جداً هنا أن نوضح الفرق بين الاستخدام اللغوي العادي والاستخدام التقني:
في اللغة الإنجليزية المكتوبة والمنطوقة يومياً، نستخدم دائماً كلمتين منفصلتين: else if (أو otherwise, if). أما مصطلحات مثل elsif (كلمة واحدة) أو elif (كلمة واحدة) فهي مصطلحات برمجية بحتة تعتمد كلياً على القواعد النحوية (Syntax) للغة البرمجة التي تستخدمها. ورغم أن المنطق الأساسي متطابق، فإن استخدام المصطلح الخاطئ في سياق برمجي سيؤدي إلى خطأ نحوي (Syntax Error)، بينما استخدامه في محادثة عادية سيبدو غريباً جداً.
إليك نمط التكوين العام (Pseudocode) الذي يعكس التدفق المنطقي:
IF (Condition 1 is true) THEN
Action 1
ELSE IF (Condition 2 is true) THEN
Action 2
ELSE
Default Action
لتوضيح الاختلافات التي قد تصادفك عند قراءة نصوص تقنية باللغة الإنجليزية، تأمل هذا الجدول المقارن الذي يوضح كيف يتم التعبير عن نفس البنية المنطقية بطرق مختلفة:
| السياق (Context) | الشرط الأول (Primary If) | الشرط البديل (Secondary If) | الخيار الافتراضي (Catch-all Else) | الكلمة المستخدمة (Keyword) |
|---|---|---|---|---|
| الإنجليزية اليومية (Everyday English) | If it is hot... | else if it is warm... | else... | else if (كلمتين) |
| لغات C (مثل Java, JavaScript) | if (condition) | else if (condition) | else | else if (كلمتين) |
| لغات نصية (مثل Ruby) | if condition | elsif condition | else | elsif (كلمة واحدة) |
| لغات مفسرة (مثل Python) | if condition: | elif condition: | else: | elif (كلمة واحدة) |
لاحظ أنه بينما تستخدم لغة بايثون elif وتستخدم روبي elsif، فإن كلاهما يخدم نفس الوظيفة المنطقية المتمثلة في else if المكونة من كلمتين في اللغة الإنجليزية العادية. عند التحدث باللغة الإنجليزية عن هذه المفاهيم، من الضروري أن تكون واعياً بالسياق: هل تتحدث في اجتماع عمل عادي؟ استخدم else if.
هل تناقش كود بايثون مع زميلك؟ استخدم elif.
### When To Use It
فهم *متى* تستخدم هذه الهياكل الشرطية أمر بالغ الأهمية لكتابة تعليمات واضحة ومنطقية، سواء في رسالة بريد إلكتروني أو في التحدث اليومي. كل متغير يخدم غرضاً مميزاً لضمان تنفيذ الإجراءات في الظروف المناسبة تماماً.
  • جملة if المفردة (Single if statement):
استخدم if منفردة عندما يعتمد الإجراء على شرط واحد محدد، ولا يوجد إجراء بديل معين إذا لم يتحقق هذا الشرط. التركيز هنا ينصب فقط على النتيجة الإيجابية.
*مثال:* If you go to the Souq, buy some dates. (إذا ذهبت إلى السوق، اشترِ بعض التمر). إذا لم تذهب، لا توجد تعليمات أخرى.
  • هيكل if-else (الشرط والبديل الوحيد):
استخدم هذا الهيكل عندما يكون هناك نتيجتان محتملتان فقط بناءً على شرط واحد. هذا الهيكل يجبرك على الاختيار بين مسارين: واحد إذا كان الشرط صحيحاً، وآخر إذا كان خاطئاً.
*مثال:* If the meeting is on Friday, I will not attend; else, I will be there. (إذا كان الاجتماع يوم الجمعة، فلن أحضر؛ وإلا، سأكون هناك). هنا، يجب اتخاذ أحد المسارين.
  • سلسلة if-else if / elsif / elif (الخيارات المتعددة):
هذا هو الشكل الأكثر مرونة للتعامل مع شروط متعددة متبادلة الاستبعاد. تستخدم هذه السلسلة عندما يكون لديك مجموعة من الحالات أو المعايير المحتملة، وواحد منها فقط يمكن أن يكون صحيحاً في أي لحظة.
*مثال من الحياة اليومية (نظام الدرجات):*
If the score is 90 or above, the grade is A;
else if the score is 80 or above, the grade is B;
else if the score is 70 or above, the grade is C;
else, the grade is F.
في هذه السلسلة، إذا حصل الطالب على 95، فسيتم تشغيل تعيين الدرجة 'A' فقط، لأن شرط if الأول قد تحقق، وسيتم تخطي جميع فحوصات else if اللاحقة. هذا يضمن الاتساق المنطقي ويمنع الإجراءات المتناقضة.
### Common Mistakes
يقع المتعلمون العرب غالباً في بعض الأخطاء الشائعة عند استخدام هذه الروابط الشرطية، ويرجع الكثير من ذلك إلى التداخل اللغوي (L1 Transfer) من اللغة العربية إلى الإنجليزية.
1. الترجمة الحرفية لـ «وإذا» إلى and if:
في اللغة العربية، من الطبيعي جداً أن نقول: «إذا جاء أحمد، سنبدأ الاجتماع. وإذا لم يأتِ، سنلغيه». المتعلم العربي قد يترجم هذا حرفياً إلى:
If Ahmed comes, we will start. And if he doesn't, we will cancel.
رغم أن هذا مفهوم، إلا أنه ليس الأسلوب الأكثر طبيعية أو احترافية في الإنجليزية. الأفضل استخدام المنطق الشرطي السليم:
If Ahmed comes, we will start; otherwise, we will cancel. أو ...else, we will cancel.
استخدام and if لربط بدائل متبادلة الاستبعاد يبدو ركيكاً للمتحدث الأصلي.
2. الخلط بين الشروط المستقلة وسلسلة if-else if:
هذا خطأ منطقي فادح. استخدام سلسلة من جمل if المنفصلة يعني أنه سيتم تقييمها *جميعاً*، بغض النظر عما إذا كانت شروط if السابقة صحيحة أم لا.
تخيل أنك تقول:
If it is Ramadan, we fast.
If it is a holiday, we rest.
إذا تصادف أن اليوم هو يوم عطلة في شهر رمضان، فستقوم بالأمرين معاً (الصيام والراحة). لكن إذا كنت تقصد خيارات متبادلة (إما هذا أو ذاك)، فيجب استخدام السلسلة:
If you want meat, we go to a Mandi restaurant; else if you want fast food, we go for Shawarma.
إذا لم تستخدم else if، فقد ينتهي بك الأمر بطلب المندي والشاورما معاً في نفس الوقت!
3. الترتيب الخاطئ للشروط (Incorrect Order of Conditions):
في سلسلة else if، ترتيب الشروط مهم جداً لأن التقييم يتوقف بمجرد العثور على شرط صحيح (Short-circuiting). الخطأ الشائع هو وضع شرط عام قبل شرط أكثر تحديداً يقع ضمن نطاقه.
*مثال خاطئ:* If age > 10, you are a teenager; else if age > 18, you are an adult.
إذا كان عمر الشخص 20 عاماً، فسيقول النظام إنه مراهق! لماذا؟ لأن 20 أكبر من 10 (الشرط الأول تحقق)، فتتوقف السلسلة فوراً ولا تصل أبداً إلى فحص ما إذا كان أكبر من 18.
*الصواب:* ابدأ بالأكثر تحديداً أو الأكبر: If age > 18, adult; else if age > 10, teenager.
4. إساءة استخدام المصطلحات البرمجية في الكتابة العادية:
كما ذكرنا، كتابة elsif أو elif في مقال للجامعة أو رسالة بريد إلكتروني لمديرك يعتبر خطأً إملائياً. هذه الكلمات مخصصة فقط لبيئات البرمجة (Python, Ruby وغيرها). في اللغة الإنجليزية القياسية، استخدم دائماً else if (كلمتين منفصلتين).
### Contrast With Similar Patterns
لفهم أعمق، دعونا نقارن بين استخدام جمل if المتعددة المستقلة (Multiple Independent Ifs) وبين سلسلة if-else if المتصلة. هذا التمييز جوهري في بناء الجمل المعقدة.
| وجه المقارنة | جمل if المستقلة (Multiple ifs) | سلسلة if-else if (Chain) |
|---|---|---|
| آلية العمل | يتم فحص كل شرط على حدة، حتى لو تحقق الشرط الذي قبله. | يتوقف الفحص فوراً بمجرد تحقق أول شرط صحيح. |
| النتيجة المحتملة | يمكن تنفيذ عدة إجراءات في نفس الوقت. | يتم تنفيذ إجراء واحد فقط كحد أقصى. |
| المقابل في العربية | تعادل استخدام «و» (مثال: إذا زرتنا سنكرمك، وإذا أحضرت هدية سنشكرك). | تعادل «أما إذا» أو «وإلا إذا» (مثال: إذا أردت الشاي سأحضره، أما إذا أردت القهوة فسأصنعها). |
| مثال بالإنجليزية | If you are cold, wear a coat.If it is raining, take an umbrella.*(يمكنك ارتداء معطف وأخذ مظلة معاً)* | If the light is red, stop.Else if the light is green, go.*(لا يمكنك التوقف والانطلاق معاً)* |
كما ترى، اختيار النمط يعتمد كلياً على ما إذا كانت الأحداث يمكن أن تقع معاً، أو ما إذا كانت بدائل تلغي بعضها البعض.
### Quick FAQ
س 1: هل يمكنني استخدام else if في المحادثات الإنجليزية اليومية (Spoken English)؟
نعم، ولكن في المحادثات اليومية يميل المتحدثون الأصليون إلى استخدام عبارات أكثر انسيابية مثل otherwise, if أو ببساطة but if. مثلاً: If you're tired, go to sleep; otherwise, if you have energy, let's watch a movie. استخدام else if شائع ومقبول جداً في السياقات الرسمية والعملية.
س 2: لماذا توجد تهجئات مختلفة مثل elsif و elif إذا كانت تعني نفس الشيء؟
هذا يعود حصرياً إلى مصممي لغات البرمجة. مبتكر لغة Python أراد اختصار الكلمات لتوفير مساحة الكتابة فاختار elif، بينما مبتكر Ruby فضل elsif. في قواعد اللغة الإنجليزية القياسية، لا وجود لهذه الكلمات المختصرة؛ الكلمة الصحيحة لغوياً هي دائماً else if.
س 3: هل هناك حد أقصى لعدد مرات استخدام else if في جملة واحدة؟
نحوياً ومنطقياً، لا يوجد حد. يمكنك وضع 20 جملة else if متتالية. ولكن من ناحية الأسلوب (Stylistically)، السلاسل الطويلة جداً تصبح صعبة القراءة ومربكة.
في الإنجليزية المكتوبة، إذا كان لديك خيارات كثيرة جداً، فمن الأفضل إعادة صياغة الجملة أو استخدام قوائم نقطية (Bullet points) لتوضيح الشروط بدلاً من سلسلة طويلة ومعقدة.
س 4: هل يجب دائماً أن أنهي السلسلة بـ else؟
لا، ليس شرطاً. يمكنك أن تبدأ بـ if وتتبعها بـ else if وتتوقف هناك. إذا لم يتحقق أي منهما، فلن يحدث شيء ببساطة. استخدام else في النهاية هو فقط لضمان وجود «خطة بديلة» (Fallback) في حال فشل كل الشروط السابقة.

The Logical Flow Table

Part Function Natural English Equivalent Example
If
Starts the condition
In the event that
If it rains...
Else if
Adds a second condition
But if / Or if
...else if it snows...
Else
The final alternative
Otherwise / Or else
...else, stay home.
Elsif
Technical contraction
N/A (Coding only)
elsif (x > 0)

Common Contractions and Phrases

Full Form Common Phrase Context
Or else
Do it, or else!
Warning/Threat
Else if
Or if
Conversation
If not
Unless
General usage
If so
If that is true
Confirmation

Meanings

These terms are used to create conditional sentences where an action depends on whether a specific requirement is met.

1

The Primary Condition (If)

Introduces the first requirement or possibility in a logical sequence.

“If you are hungry, we can eat now.”

“I will go if you go.”

2

The Alternative (Else)

Used to describe what happens if the 'if' condition is not met. In spoken English, often replaced by 'otherwise'.

“You must pay the fine, or else you will go to jail.”

“Eat your vegetables; else, no dessert!”

3

The Secondary Condition (Else-if)

Used when the first 'if' is false, but you want to check a second specific condition before giving up.

“If it's 10:00, I'm working; else if it's 12:00, I'm eating.”

“If the red light is on, stop; else if the yellow light is on, slow down.”

4

The Technical Contraction (Elsif)

A specific spelling used in programming languages (like Ruby or Perl) to mean 'else if'.

“The programmer used 'elsif' to save space in the code.”

“You won't find 'elsif' in a standard English dictionary.”

Reference Table

Reference table for If مقابل Else-if مقابل Elsif: ما الفرق؟
المصطلح الغرض منه اللغات الشائعة مثال على الصيغة
`if`
بيبدأ الكتلة الشرطية. بيتم فحصه دايمًا.
الكل (JS, Python, Ruby, Java)
`if (x > 10)`
`else if`
بيفحص شرط جديد لو اللي قبله كان خطأ.
JavaScript, Java, C++, C#
`else if (x > 5)`
`elsif`
مرادف مختصر لـ `else if`.
Ruby, Perl, Ada
`elsif x > 5`
`elif`
مرادف مختصر آخر لـ `else if`.
Python, Bash scripting
`elif x > 5:`
`else`
الخيار الأخير اللي بيتنفذ لو كل الشروط فشلت.
الكل (JS, Python, Ruby, Java)
`else`

طيف الرسمية

رسمي
Should it rain, the event will be moved indoors; otherwise, it will remain outside.

Should it rain, the event will be moved indoors; otherwise, it will remain outside. (Event planning)

محايد
If it rains, we'll go inside; else, we'll stay here.

If it rains, we'll go inside; else, we'll stay here. (Event planning)

غير رسمي
If it rains, we're going in. If not, we're staying out.

If it rains, we're going in. If not, we're staying out. (Event planning)

عامية
Rain? We're inside. No rain? We're chillin' out here.

Rain? We're inside. No rain? We're chillin' out here. (Event planning)

تدفق المنطق الشرطي

الفحص الشرطي

الفحص الأساسي

  • if Starts the logic

الفحوصات الثانوية

  • else if Common follow-up
  • elsif Ruby/Perl version
  • elif Python version

الخيار الأخير

  • else If nothing matches

مقارنة الكلمات المفتاحية: `else if` مقابل `elsif`

`else if`
مفهومة عالمياً Used in JS, Java, C++
كلمتان Has a space
`elsif` / `elif`
خاصة بلغات معينة Ruby, Python, Perl
كلمة واحدة Shorter, no space

أي كلمة مفتاحية يجب أن أستخدم؟

1

هل تبدأ فحصاً شرطياً جديداً؟

YES
استخدم `if`
NO
انتقل للخطوة التالية
2

هل تبرمج بلغة بايثون؟

YES
استخدم `elif`
NO
انتقل للخطوة التالية
3

هل تبرمج بلغة Ruby أو Perl؟

YES
استخدم `elsif`
NO
استخدم `else if`

الكلمات المفتاحية حسب عائلة اللغة

🔵

نمط C (JS, Java, C#)

  • if
  • else if
  • else
🟡

بايثون

  • if
  • elif
  • else
🔴

روبي وبيرل

  • if
  • elsif
  • else

أمثلة حسب المستوى

1

If it is cold, wear a coat.

If it is cold, wear a coat.

2

If you are happy, smile.

If you are happy, smile.

3

I will come if you ask.

I will come if you ask.

4

If I see him, I will say hello.

If I see him, I will say hello.

1

If you don't like it, don't eat it.

If you don't like it, don't eat it.

2

We can go to the park, or else we can stay here.

We can go to the park, or else we can stay here.

3

If she calls, tell me.

If she calls, tell me.

4

If it rains, we will go to the cinema.

If it rains, we will go to the cinema.

1

If the price is low, buy it; else, wait for a sale.

If the price is low, buy it; else, wait for a sale.

2

If you are tired, sleep; else if you are bored, read a book.

If you are tired, sleep; else if you are bored, read a book.

3

You must study, else you will fail the exam.

You must study, else you will fail the exam.

4

If he arrives early, wait; else if he is late, call him.

If he arrives early, wait; else if he is late, call him.

1

If the results are inconclusive, we must retest; else, we proceed.

If the results are inconclusive, we must retest; else, we proceed.

2

If you had told me, I would have helped; else, I had no idea.

If you had told me, I would have helped; else, I had no idea.

3

The software checks if the user is logged in; else if the guest mode is on, it allows access.

The software checks if the user is logged in; else if the guest mode is on, it allows access.

4

If you find any errors, please let us know; else, enjoy the book.

If you find any errors, please let us know; else, enjoy the book.

1

Should the market crash, we have a backup; else, we remain invested.

Should the market crash, we have a backup; else, we remain invested.

2

If one considers the ethical implications, the choice is clear; else, it remains a gray area.

If one considers the ethical implications, the choice is clear; else, it remains a gray area.

3

The script uses an 'elsif' ladder to handle various user inputs efficiently.

The script uses an 'elsif' ladder to handle various user inputs efficiently.

4

If the treaty is signed, peace is possible; else, conflict is inevitable.

If the treaty is signed, peace is possible; else, conflict is inevitable.

1

Were it not for his intervention, the project would have failed; else, we would be celebrating now.

Were it not for his intervention, the project would have failed; else, we would be celebrating now.

2

The linguistic distinction between 'if' and 'else' mirrors the binary nature of human decision-making.

The linguistic distinction between 'if' and 'else' mirrors the binary nature of human decision-making.

3

If the premise holds, the conclusion follows; else, the entire argument collapses.

If the premise holds, the conclusion follows; else, the entire argument collapses.

4

The code was riddled with 'elsif' statements, suggesting a lack of polymorphic design.

The code was riddled with 'elsif' statements, suggesting a lack of polymorphic design.

سهل الخلط

If vs. Else-if vs. Elsif: What's the Difference? مقابل If vs. Whether

Both can introduce options, but 'whether' is for two fixed choices, while 'if' is for a condition.

If vs. Else-if vs. Elsif: What's the Difference? مقابل Else vs. Otherwise

Learners use 'else' as a transition word, which is rare.

If vs. Else-if vs. Elsif: What's the Difference? مقابل If vs. When

'If' is for possibility; 'when' is for certainty.

أخطاء شائعة

If it rain, I stay.

If it rains, I stay.

The 'if' clause often uses the present simple third-person 's'.

I will go if.

I will go if you go.

'If' needs a condition to follow it.

If I am happy then I smile.

If I am happy, I smile.

In modern English, 'then' is often unnecessary and can be replaced by a comma.

If it is hot? Yes.

Is it hot? If so, yes.

Don't use 'if' to ask a simple question.

If you want, else I go.

If you want, stay; otherwise, I'm going.

'Else' needs a result before it.

If it rains, or else we stay.

If it rains, we stay.

Don't mix 'if' and 'or else' in the same clause.

If I will see him, I will tell him.

If I see him, I will tell him.

Don't use 'will' in the 'if' clause.

I used elsif in my email.

I used 'or if' in my email.

'Elsif' is for coding only.

If it's red, stop, else if it's green, go.

If it's red, stop; if it's green, go.

'Else if' is grammatically correct but sounds robotic in speech.

He is coming, else?

He is coming, or what else?

'Else' cannot stand alone at the end of a question like this.

If I was you, I'd go.

If I were you, I'd go.

In formal English, use the subjunctive 'were'.

Should it rain, else we go.

Should it rain, we shall stay; otherwise, we go.

Inverted conditionals need formal balancing.

If the code has an else-if...

If the code has an 'else if'...

Even in technical writing, use the space unless referring to the keyword.

أنماط الجُمل

If it ___, I will ___.

I need to ___, else I will ___.

If you ___, then ___; else if you ___, then ___.

Should you ___, please ___.

Real World Usage

Texting constant

If u r free, let's hang. Else, ttyl!

Job Interview common

If I am hired, I will work hard; else, I will continue my search.

Ordering Food very common

If you have the vegan option, I'll take that; else, just the salad.

Travel common

If the flight is delayed, call the hotel; else, take a taxi.

Social Media occasional

If you like this post, share it! Else, just keep scrolling.

Coding constant

if (user.admin?) { show_dashboard } elsif (user.guest?) { show_welcome } else { redirect_to_login }

💡

خليك مع `else if` كخيار افتراضي

لما تحكي عن البرمجة بشكل عام، else if هي المصطلح الأشهر والمفهوم للكل. استخدمها دايمًا إلا لو كنت بتبرمج بلغة محددة:
Use else if as your default.
⚠️

لا تلخبط بين `elif` و `elsif`

بايثون بتستخدم elif أما روبي بتستخدم elsif. لو استخدمت الغلط الكود رح يوقف:
Python uses elif, but Ruby uses elsif.
🎯

فكر في استخدام `switch`

لو لقيت نفسك كاتب سلسلة طويلة من else if (أكثر من 5)، جرب switch لأنها أرتب:
A switch statement is cleaner for many options.
🌍

مجرد مسألة ذوق وتصميم

الفرق بين else if و elsif هو مجرد ذوق في تصميم لغة البرمجة. المبرمجين بيحبوا يتناقشوا مين أحلى: "It's just a matter of syntactic sugar."

Smart Tips

Change it to 'Otherwise'. It sounds much more natural to native ears.

Else, we can meet tomorrow. Otherwise, we can meet tomorrow.

Check if the book is about computer science. If not, it might be a typo!

He said elsif he was tired... He said that if he was tired...

Use 'Should you' instead of 'If you'.

If you need help, ask. Should you need help, please ask.

Use 'or else' at the end of the condition.

If you don't stop, I will be mad. Stop that, or else!

النطق

/ɪf/ you /GO/, I /STAY/

The 'If' Stress

In a conditional sentence, the stress is usually on the 'if' and the main verb of the result.

Stay (rise)... else (fall) leave.

Else Intonation

When using 'else' as an alternative, your voice usually rises on the first option and falls on the 'else' option.

The Choice Pattern

If it's A ↗️, then B ↘️.

Conveys a clear logical consequence.

احفظها

وسيلة تذكّر

IF starts the car, ELSE IF changes gears, and ELSE is the parking brake.

ربط بصري

Imagine a traffic light. IF it's red, stop. ELSE IF it's yellow, slow down. ELSE (it must be green), go!

Rhyme

If for one, Else if for two, Else for when you're finally through.

Story

A traveler reaches a bridge. IF he has a coin, he crosses. ELSE IF he has a sword, he fights. ELSE, he turns back home.

Word Web

IfElseElse-ifOtherwiseUnlessConditionResult

تحدٍّ

Write a 3-step instruction for making coffee using If, Else if, and Else.

ملاحظات ثقافية

In Silicon Valley and tech hubs, 'if-else' logic is often used as a metaphor for life decisions.

British speakers often use 'otherwise' or 'or else' more frequently than 'else' in casual conversation.

Legal documents use 'if' and 'else' (often as 'failing which') to create airtight contracts.

'If' comes from the Old English 'gif', meaning 'given that'. 'Else' comes from 'elles', meaning 'other'.

بدايات محادثة

If you could travel anywhere right now, where would you go?

If it rains this weekend, what are your backup plans?

What happens if you forget your keys?

If you were the president, what is the first law you would change?

مواضيع للكتابة اليومية

Write about your morning routine using at least three 'if' statements.
Describe a difficult decision you made. Use 'if', 'else if', and 'otherwise'.
Imagine a world where it never rains. How would life be different? Use 'if' and 'else'.
Write a set of instructions for a robot to make a sandwich.

أخطاء شائعة

Incorrect

صحيح


Incorrect

صحيح


Incorrect

صحيح


Incorrect

صحيح

Test Yourself

اختر الكلمة المفتاحية الصحيحة لكود JavaScript.

if (score > 90) { grade = 'A'; } ___ (score > 80) { grade = 'B'; }

✓ Correct! ✗ Not quite. Correct answer: else if
لغة JavaScript، مثل Java و C++، تستخدم الكلمتين المنفصلتين else if للفحوصات اللاحقة.
أي جملة تصف الكلمة المفتاحية في لغة Python بشكل صحيح؟

اختر الجملة الصحيحة:

✓ Correct! ✗ Not quite. Correct answer: تستخدم Python كلمة `elif` للشروط الإضافية.
elif هي الكلمة المحددة التي تستخدمها بايثون كاختصار لـ 'else if'.
ابحث عن الخطأ وصححه في هذه الجملة المتعلقة بلغة Ruby.

لإضافة فحص آخر في Ruby، نستخدم الكلمة المفتاحية `else if`.

✓ Correct! ✗ Not quite. Correct answer: لإضافة فحص آخر في Ruby، نستخدم الكلمة المفتاحية `elsif`.
لغة Ruby هي واحدة من اللغات المحددة التي تستخدم اختصار elsif.

Score: /3

تمارين تطبيقية

8 exercises
Choose the correct word to complete the sentence. اختيار متعدد

If you are tired, go to bed; ___, you will be grumpy tomorrow.

✓ Correct! ✗ Not quite. Correct answer: else
'Else' provides the alternative result.
Fill in the blank with 'if', 'else', or 'else if'.

___ it is 5 PM, I leave work; ___ it is 6 PM, I am at the gym.

✓ Correct! ✗ Not quite. Correct answer: If / else if
The first starts the condition, the second adds another specific one.
Correct the error in this sentence. Error Correction

Find and fix the mistake:

If I will see her, I will tell her.

✓ Correct! ✗ Not quite. Correct answer: If I see her
We don't use 'will' in the 'if' clause.
Match the condition to the result. Match Pairs

1. If it's hot... 2. Else if it's cold... 3. Else...

✓ Correct! ✗ Not quite. Correct answer: 1-B, 2-A, 3-C
Matching logical conditions to appropriate actions.
Put the words in the correct order. Sentence Reorder

else / study / you / will / fail / hard

✓ Correct! ✗ Not quite. Correct answer: Study hard, else you will fail.
The command comes first, followed by the 'else' alternative.
Is this rule true or false? True False Rule

You can use 'elsif' in a formal business letter.

✓ Correct! ✗ Not quite. Correct answer: False
'Elsif' is a programming keyword, not a standard English word.
Complete the dialogue. Dialogue Completion

A: Are you coming to the party? B: If I finish my work, yes; ___, I'll have to stay home.

✓ Correct! ✗ Not quite. Correct answer: else
'Else' shows the alternative to finishing work.
Rewrite the sentence using 'if'. Sentence Transformation

Stay here or you will get wet.

✓ Correct! ✗ Not quite. Correct answer: If you don't stay here, you will get wet.
The 'or' structure can be transformed into a negative 'if' condition.

Score: /8

Practice Bank

14 exercises
أكمل الجملة بالمصطلح الصحيح. املأ الفراغ

أنا أكتب بلغة Ruby، لذا أحتاج لاستخدام ___ بدلاً من `else if`.

✓ Correct! ✗ Not quite. Correct answer: elsif
أي جملة هي الصحيحة لمبرمج C++؟ اختيار متعدد

اختر الجملة الصحيحة:

✓ Correct! ✗ Not quite. Correct answer: In C++, `else if` is the standard for checking another condition.
ابحث عن الخطأ في تعليق المبرمج وصححه. Error Correction

My Python code is broken. The `elsif` statement is causing a syntax error.

✓ Correct! ✗ Not quite. Correct answer: My Python code is broken. The `elif` statement is causing a syntax error.
اختر الكلمة المفتاحية الصحيحة للغة بايثون. املأ الفراغ

الكود يفحص `if user_type == 'admin':` وبعدها `___ user_type == 'editor':`

✓ Correct! ✗ Not quite. Correct answer: elif
طابق كل لغة برمجة بالكلمة المفتاحية الصحيحة لها. Match Pairs

صل اللغة بالكلمة المفتاحية الخاصة بها لـ 'else if':

✓ Correct! ✗ Not quite. Correct answer: matched
ترجم المفهوم إلى جملة إنجليزية صحيحة. الترجمة

ترجم إلى الإنجليزية: في سياق البرمجة، ما هو المصطلح الأكثر عمومية وفهماً للفحص الشرطي الذي يلي 'if'؟

✓ Correct! ✗ Not quite. Correct answer: ["The most generic term is else if.","It's generally called an else if statement."]
ضع الكلمات في الترتيب الصحيح لتكوين جملة صحيحة. Sentence Reorder

رتب الكلمات لتكوين جملة:

✓ Correct! ✗ Not quite. Correct answer: `elsif` is Ruby's shorthand for `else if`
أي من هذه الجمل صحيحة عالمياً؟ اختيار متعدد

اختر الجملة الصحيحة:

✓ Correct! ✗ Not quite. Correct answer: All languages use `if` to start a conditional.
ابحث عن الخطأ في الجملة وصححه. Error Correction

Using `elif` in a JavaScript file is a common practice.

✓ Correct! ✗ Not quite. Correct answer: Using `else if` in a JavaScript file is a common practice.
ضع الكلمات في الترتيب الصحيح لتكوين قاعدة صحيحة. Sentence Reorder

رتب الكلمات لتكوين جملة:

✓ Correct! ✗ Not quite. Correct answer: You must use `elif` when coding in Python.
طابق المصطلح بالوصف المناسب له. Match Pairs

طابق المصطلح الشرطي بدوره:

✓ Correct! ✗ Not quite. Correct answer: matched
اكتب الجملة الإنجليزية الصحيحة. الترجمة

ترجم إلى الإنجليزية: ما هو السبب الرئيسي لاستخدام لغة ما لـ `elsif` بدلاً من `else if`؟

✓ Correct! ✗ Not quite. Correct answer: ["It's mainly for brevity and developer convenience.","The main reason is for conciseness.","It's a stylistic choice for making code shorter."]
أكمل تفكير المبرمج. املأ الفراغ

حسناً، الفحص الأول هو `if (is_ready)`. الفحص التالي يجب أن يكون `___ (is_waiting)` لأنني أكتب بلغة Java.

✓ Correct! ✗ Not quite. Correct answer: else if
ابحث عن الخطأ في هذه الجملة وصححه. Error Correction

The main difference between `if` and `else if` is that `if` is optional.

✓ Correct! ✗ Not quite. Correct answer: The main difference between `if` and `else if` is that `else if` is optional.

Score: /14

الأسئلة الشائعة (8)

In English, no. In programming languages like Ruby, yes. In writing, always use 'else if' or 'or if'.

Rarely. It usually follows a comma or a semicolon. Use 'Otherwise' to start a new sentence.

'Unless' means 'if not'. 'Unless it rains' is the same as 'If it doesn't rain'.

Only if the 'if' clause comes at the beginning of the sentence.

It can be! If you don't finish the sentence, it sounds like a threat. 'Do it, or else!'

Yes! 'Who else is coming?' or 'What else do you need?' are very common.

It's a shortcut to save typing and make the code run slightly faster in some older languages.

It's when you put an 'if' inside another 'if'. 'If it's Monday, then if it's raining, I stay home.'

Scaffolded Practice

1

1

2

2

3

3

4

4

Mastery Progress

Needs Practice

Improving

Strong

Mastered

In Other Languages

Spanish high

si / sino / o si no

Spanish has a specific word 'sino' for 'else' when it means 'but instead'.

French high

si / sinon

French 'si' can also mean 'yes' in response to a negative question, which 'if' cannot do.

German moderate

wenn / falls / sonst

German uses 'wenn' for both 'if' and 'when', which is a major point of confusion for learners.

Japanese low

moshi / nara / tara

Japanese conditionals are built into the verb conjugation, not just placed at the start of the sentence.

Arabic moderate

in / idha / law

English uses 'if' for all three, relying on verb tenses to show the difference.

Chinese moderate

rúguǒ / yàobù

Chinese often omits the 'if' word entirely if the context is clear.

Learning Path

Prerequisites

Was this helpful?
لا توجد تعليقات بعد. كن أول من يشارك أفكاره!