Skip to content

Move makefile tutorial to lab 3 #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
adeet1 opened this issue Nov 1, 2019 · 4 comments
Open

Move makefile tutorial to lab 3 #41

adeet1 opened this issue Nov 1, 2019 · 4 comments

Comments

@adeet1
Copy link

adeet1 commented Nov 1, 2019

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.

@winstliu
Copy link

winstliu commented Jan 5, 2020

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
Copy link
Author

adeet1 commented Jan 9, 2020

@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?

@winstliu
Copy link

winstliu commented Jan 11, 2020

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
Copy link
Author

adeet1 commented Jan 11, 2020

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

@adeet1 adeet1 changed the title Move makefile tutorial to lab 1 Move makefile tutorial to lab 3 Jan 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants