Skip to content
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

Better exercises for lambda and stl #416

Open
HereThereBeDragons opened this issue Mar 2, 2023 · 4 comments
Open

Better exercises for lambda and stl #416

HereThereBeDragons opened this issue Mar 2, 2023 · 4 comments
Labels
Essentials Content for the "essentials" course stale

Comments

@HereThereBeDragons
Copy link

After having a longer discussion yesterday with bernhard, i got the following idea how the difficulty of understanding lambdas and stl could be eased.

I would suggest the following exercises (in order of execution):

  1. lambda simple: exercise to write simple lambda function, maybe even start with rewritting an existing function by a lambda - no usage of stl
  2. lambda and stl - simple: rewrite an (existing & fully functioning) program that uses stl with function object to replace these function objects with lambdas
  3. lambda and stl - advanced: have an unfinished program where stl functions and their respective lambdas must be added. could be that in the readme there is a list of possible stl functions to decide from
@welcome
Copy link

welcome bot commented Mar 2, 2023

Thanks for opening your first issue here! If you have any questions, feel free to mention one of the conveners, previous contributors, or attend our weekly meeting (see https://hepsoftwarefoundation.org/workinggroups/training.html). Also, sometimes issues go unnoticed, so don't hesitate to @mention some of us, if we do not come back to you within a few days.

@bernhardmgruber
Copy link
Contributor

Thx @HereThereBeDragons for sketching that outline! I indeed think that the stl exercise mixes a lot of things at the moment and that we could improve it.

Historically, we had separate exercises for the STL and for lambdas. However: in the opposite order. We first introduced the STL using function objects, and then we had an exercise to convert a program using STL with function objects into a program using STL and lambdas. I campaigned for merging the two because I don't want students to practice writing function objects. Lambdas are just superior in most situations. That explains the status quo.

I especially like your suggestion 1. of having a dedicated exercise on lambda functions without any STL. I would then still combine 2. and 3., because the starting point for the current stl exercise already gives you all the names of the STL functions you should use. I think we may even had your suggestion 2. at some point, but it took too long for the students to figure out how to refactor a non-STL program into an STL one. Which is why we provide the combined approach.

@bernhardmgruber bernhardmgruber added the Essentials Content for the "essentials" course label Mar 5, 2023
@HereThereBeDragons
Copy link
Author

I personally would keep 2. and 3. separate and have 3. as bonus exercise for the essential course and as a quick refresher exercise for the advanced course.

Also I personally would vary a bit that you use more than just 2 STL functions

Copy link

stale bot commented Mar 5, 2024

This issue or pull request has been automatically marked as stale because it has not had recent activity. Please manually close it, if it is no longer relevant, or ask for help or support to help getting it unstuck. Let me bring this to the attention of @klieret @wdconinc @michmx for now.

@stale stale bot added the stale label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Essentials Content for the "essentials" course stale
Projects
None yet
Development

No branches or pull requests

2 participants