You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
show some tricks for quicker compile-run cycles in the CLI (use '&&' for joining commands and "↑" for accessing the previous command)
let the students describe boolean conditions via propositional logic on the whiteboard before they make a C++ implementation
let them describe formally their tasks (when the problem is in the form "how many numbers satisfy X" or "print the numbers which satisfy Y") using set-notation and predicate calculus
let them find formulas for directly computing easier counting tasks (e.g. numbers divisible by N and M, less than 10³); probably on the whiteboard in parallel with the code-writing student.
describe some tasks using only set notation and predicate calculus, no words, and let the students infer the meaning
The text was updated successfully, but these errors were encountered:
prepare students for a few things needed later in the course when teaching arrays
explain what is a constant, the difference between compile-time and runtime constants (const vs constexpr), how these can be used for safer code, what is sizeof.
code-hunger
changed the title
Rough ideas for pract. Oct. 21
Rough ideas for pract. lessons
Oct 28, 2019
I lied about the impossibility for T var[n] (where n is non-constexpr) due to unextendability of the array. It is possible, and is available in C99, though its usage is discoraged.
The problem's actually that the type system becomes kind of unstable (@todo think of a better word) at compile-time (E.g. sizeof will become non-constexpr).
explain why you can't do stuff like array.size() or why there can't be such a thing as length(array), neither theoretically nor in practice (when working with arrays directly initialized in memory, be it the stack or the heap).
explain how arrays in C/C++ are "pure", in the sense that we directly operate on the underlying data; talk about the complete lack of abstraction, that we're concrete as hell, what power this gives us and what errors are terribly easy to make and how to avoid them.
The text was updated successfully, but these errors were encountered: