Divide class into two groups, and each group into "pairs" (may be three in a pair). Assign each pair in a group a different coding exercise, to be completed as quickly as possible, with rough code. After solution committed the code shifts to the other group to review and revise for improvement, committing changes. Have the overall group review the changes in each case and present a summary of why changes were made, such as code clarity, efficiency in speed, efficiency in memory usage, etc.
Divide class into two groups, and each group into "pairs" (may be three in a pair). Assign each pair in a group a different coding exercise, to be completed as quickly as possible, with rough code. After solution committed the code shifts to the other group to review and revise for improvement, committing changes. Have the overall group review the changes in each case and present a summary of why changes were made, such as code clarity, efficiency in speed, efficiency in memory usage, etc.