uva-cs / pdr

A repo for a Program and Data Representation university-level course
Other
91 stars 227 forks source link

Move makefile tutorial to lab 3 #41

Open adeet1 opened 4 years ago

adeet1 commented 4 years ago

I feel that it would be beneficial to teach Makefiles earlier in the course, because it is much easier for students to run make rather than clang++ file1.cpp file2.cpp file3.cpp ....

The in-lab component of lab 1 would especially be suitable for a makefile tutorial, as this lab component requires students to split a C++ program into multiple .h and .cpp files. This fits in well with the concept of dependencies (e.g. LifeCycle.cpp depends on LifeCycle.h).

Additionally, the various stages of compiling a C++ program were taught at the beginning of the semester (preprocessor, linker, assembler, etc.), which would fit in well with the concept of compiling .cpp files into .o files (with the -c flag), linking these .o files, etc.

50Wliu commented 4 years ago

I like this idea of introducing Makefiles earlier, but the main issue I see with moving it to Lab 1 is that the Makefile syntax is quite...unwieldy. It's also always a good thing to teach students how to manually compile before giving them the nicer tools on top. Though...the in-lab and post-lab for Lab 1 are pretty empty. Perhaps we could squeeze it in there.

I've also been thinking about this a bit, mostly because C++11 has so many nice features that I wish we could let students use -- what if we start providing Makefiles in Lab 2 that do the Right Thing, and then formally introduce it to them in Lab 5?

adeet1 commented 4 years ago

@50Wliu I think this is a great idea. As you said, we can start providing pre-written Makefiles in lab 2. But I think it would be better to formally introduce them in lab 3, as that is one of the easier labs, instead of lab 5.

Specifically, I think the in-lab of lab 3 would be good because as of now, it's very lightweight (only requiring students to change their implementation from hard-coded to accepting user input).

@aaronbloomfield Can you please provide your thoughts on this?

50Wliu commented 4 years ago

I think the in-lab of lab 3 would be good because as of now, it's very lightweight

This sounds good to me. The in-lab has actually historically been a little tricky because some people start to overthink how to distinguish operators from numbers and end up way over-utilizing isdigit. We've cleaned that up a bit now, though, so the implementation should hopefully be smoother.

(And not to mention we'll be able to point them to stoi instead of atoi, as well!)

adeet1 commented 4 years ago

@50Wliu Ok, I can work on a pull request for this.