RHIT-CSSE / csse332

This is the course repo for CSSE 332 @ Rose-Hulman
https://www.rose-hulman.edu/class/csse/csse332/current/
MIT License
8 stars 63 forks source link

Add more practice with read/write functions #11

Open wynessgp opened 9 months ago

wynessgp commented 9 months ago

Some students have run into issues with their C programs frequently "hanging" as soon as they start using read() and write().

Most times this issue is caused by students reading & writing an inconsistent (or incorrect) amount of bytes from the file. Often they will read too many bytes and cause the file cursor to be moved too far forward, and consequently no longer be able to read anything. Since read is a blocking call, the program consequently hangs, much to students' confusion.

While students mostly learn about read & write in the prerequisite courses, it may be worthwhile to include more exercises related to read & write in the process lab, as it will help get students prepared for exam 1. It can also help fill some of the gaps in any prerequisite knowledge, and reduce the number of errors we see related to it on assignments.

mahays0 commented 9 months ago

I worry when I see students copy/paste large examples verbatim without really thinking about it. That's what I see right now wrt read and write.

There are a couple of idioms students seem to use:

They should know how to do the corresponding read/write operations on the other end without copying the corresponding practice problem.