-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
[Concept] Docs - Functions #699
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall.
But do we really need const
in this concept?
For me const
is part of the type, leaving it out would make the section about function overloading simpler.
The section about function overloading sounds a little bit technical.
If that's what you're aiming for that's fine.
I'd prefer starting with the motivation, something like
"Multiple functions can have the same name if the number or types of the parameters are different. That is usually done if these functions perform very similar tasks just with different parameters or types."
But the decision is yours, I believe the syllabus is better if there's one consistent voice.
I have seen some examples where the const conversion was not clear in the code and I thought it might as well come in here. It does not feel enough for its own concept, but too much/late to go into a constexpr concept?
I should look at that, I want the whole thing to feel more fun and "aha, interesting" than a manual text. |
@siebenschlaefer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last minute review of last minute changes
response = reply; | ||
} | ||
string answer(const string& question) const { | ||
if (question.lenghth() == 0) { return "";} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found a typo! :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, no! I will put that into the exercise for that concept
This concept is called functions, although the students are using functions from the first concept exercise.
I hope it is a good place, for them, as they introduce quite a lot of noise, that is needed for later concepts, but would not help in the early stages of the tree.
I would place these in the syllabus after references to make it clear, that a reference is also a change in the function type signature.
As an exercise, I am thinking to implement an advanced version of the lasagna cooking class from the first concept. This time it will be some bigger operation with recipes that cannot be changed and stuff that plays with overloads and defaults.
Closes #660.