Like in many programming languages, the evaluation of Boolean expressions follows some strict rules which
may lead to very subtle bugs;
The order in which terms are evaluated
The "shortcuts" taken to avoid evaluating terms which do not make a difference on the overall
truth value of the Boolean expression.
Instead of telling you right away what these rules are, this video will prompt you to write a small program
to help you assess the situation. It is very useful to learn to write such proof of concepts programs when
learning a new programming language.
Video Duration - 14"47 / Development Environment - Linux
Unlike other programming languages, we do not have "true" and "false" literals here. Instead, the rule is
Anything equal to zero is Boolean false
Anything else is Boolean true
So this means that an arithmetic expression is a valid substitute for a a Boolean one.
This exercise leads you to implement a small program to experiment with various such expressions so you may
learn how the language always tries to make sense of anything you throw at it where a Boolean expression is expected.
Video Duration - 11"11 / Development Environment - Linux
Another thing which surprises students who only learned Java is the non-portability of the C programming language.
A good way to be exposed to this is to learn the need to avoid assumptions about the number of bytes used to
stored various elementary data types.
This video will prompt you to write a small program allowing you to display on the screen the size in bytes of
various elementary data types. It even asks you to do so for data types which might not exist so you may remember
the valid combination of the type qualifiers available.
Video Duration - 10"16 / Development Environment - Linux