Ch39 Discussion
Discussion Guide
Warm-up (think–pair–share, 5 min). "You read online that a feature is 'in Fortran 2023.' What is the very next question you should ask before you use it?" (Target: "does my compiler support it?" — surfaces the shipped-vs-available gap that runs through the chapter.)
Main discussion (15–20 min).
1. The guard that isn't. Put merge(sqrt(v), 0.0, v >= 0.0) on the board. Ask the class to trace it for
v = -4. Lead them to see sqrt(-4) is computed regardless, then to the two fixes (if now, conditional
expression later). Use it to teach short-circuiting as a correctness property, not a style choice.
2. Why doesn't the committee just delete the ugly stuff? Discuss obsolescent-vs-deleted and backward
compatibility. Push on the trade: what does the language give up by never removing COMMON/fixed-form, and
what does it protect? Connect to a lab that must keep a 40-year-old validated code running.
3. Shipped vs coming. Give each group three items (say: degree trig, enumeration types, generics) and have
them sort into "use it today," "check my compiler," and "proposed — forecast only." Then defend the
sorting. This rehearses the chapter's central discipline directly.
Group activity (10 min). In pairs, students take CS-01's merge-guard / magic-number / pi/180 module
and produce (a) a portable refactor that compiles on today's gfortran and (b) a short comment block naming the
Fortran 2023 upgrade for each smell and its fallback. Swap with another pair and review: did they keep it
portable? Did they keep a fallback? Did they avoid asserting an enumeration-type syntax they hadn't verified?
Peer-reviewing for honesty about support is the transferable skill.
Exit ticket. "Name one Fortran 2023 feature you can use today, one you'd have to check your compiler for, and one that is only proposed — and say how you know which is which." (Any correct sort of, e.g., degree trig / conditional expressions / generics is a pass; it checks the chapter's whole point.)