I am a bit confused about the nomenclature for the parts of an if statement. Consider the following example:

1:  if condition then
2:      statement_1;
3:  else
4:      statement_2;
5:  end if;

What is the "if clause" in this statement? Here are a few possibilities:

  • Is it lines #1 and #2?
  • Is it line #1?
  • Is it line #2?
  • Is is the condition in line #1?

And in the same example, what would be the "then clause"?

  • Is it line #2?
  • Is it the then keyword, plus line #2?
  • Is it just a synonym for "if clause"?

My main reference is Code Complete 2nd Ed., but the author seems to use exclusively the term "if clause", with the meaning being lines #1 and #2 in this example.

  • 4
    Oh, my. How we programmers do love complicating things. Mar 31, 2014 at 19:13
  • 1
    @RobertHarvey, I also find it amusing, but I am a programmer and an aspiring writer, so I need to get the basic terminology right! :)
    – rick
    Mar 31, 2014 at 19:15
  • 2
    I am suspicious that different programmers will have different interpretations. Even if someone is able to demonstrate logically that their interpretation makes the most sense, other programmers (who have not read this explanation) will still not share such interpretations.
    – Brian
    Apr 1, 2014 at 11:49
  • As Brian said, it seems there is no single opinion. Robert Harvey provided his view, and here is another one: mathcs.emory.edu/~cheung/Courses/170/Syllabus/06/if1.html
    – john c. j.
    May 12, 2020 at 0:03

2 Answers 2


The reason you hear about conditional "clauses" is because English has clauses. When you hear about conditional clauses in programming, what the person is speaking about is "that which embodies the condition."

So the if clause is

if condition then

because that's the part that pertains to the if.

The else clause is


because that's the part that pertains to the else.

  • 4
    There is no "then" clause. "Then" is a delimiter, a keyword that separates the if clause from the else clause. Mar 31, 2014 at 19:54
  • 1
    @johnc.j. The thing you need to ask yourself is "how do you define a 'statement' in this particular programming language?" May 11, 2020 at 16:06
  • 1
    @johnc.j.: It's in the language specification. If the language specification says its a statement, it's a statement. If it's a statement that contains a conditional expression, it's a conditional statement. May 11, 2020 at 16:14
  • 1
    @johnc.j. For example, here. It says "If...Then...Else Statement." May 11, 2020 at 16:16
  • 1
    @johnc.j. And here, which calls it an "if statement". May 11, 2020 at 16:18

It is a lot easier if you write the code as

1  if condition
2  then
3      statement_1
4  else
5      statement_2
6  endif
  • 1 is the if-clause
  • 2 and 3 are the then clause
  • 4 and 5 are the else clause

In some languages, they use {}. In those terse languages, then is considered a noise word so it is dropped. In those languages, there is no then clause - 1 & 3 make up the if clause. Those using indentation only (like python) don't have a then or endif.

  • 1
    As somebody already pointed out its not a "then" clause its simply a keyword.
    – Ramhound
    Apr 1, 2014 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.