the compiler also needs to figure out that getWidth() and getHeight() are pure.
but yes, i agree with you that for an intro class, students should focus on writing clear code and then optimizing for performance later.
but yes, i agree with you that for an intro class, students should focus on writing clear code and then optimizing for performance later.
Two more lines worth it.