Skip to content

Conversation

@vaeng
Copy link
Contributor

@vaeng vaeng commented Mar 1, 2024

No description provided.

@vaeng vaeng added x:action/proofread Proofread text x:module/concept-exercise Work on Concept Exercises x:rep/large Large amount of reputation labels Mar 1, 2024
Copy link
Contributor

@siebenschlaefer siebenschlaefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the exercise itself. In the JavaScript track it's used to show how objects can be constructed and composed, IMHO a really good exercise for that because it's simple enough for beginners but not trivial.

But here the exercise is used to showcase pointers and dynamic memory allocation. That looks rather forced. Why should the position and size be passed by pointer, why should programWindow allocate memory dynamically? That just makes it more difficult, without (at least to me) clear benefits. I'm missing the motivation for that.
The dynamic memory allocation also adds the problem of ownership. Now the students have to write a destructor (and if they follow the rule of five also at least delete the copy constructor and copy assignment operator.)

I would really like a different exercise for this pointer concept, one where pointers (and maybe dynamic memory allocation) are a better fit.

@vaeng vaeng force-pushed the feat--add-exercise-for-pointer-concept branch from ff24370 to 705c8dd Compare October 1, 2024 14:44
@vaeng
Copy link
Contributor Author

vaeng commented Oct 1, 2024

@siebenschlaefer
Thanks for all the feedback, you were completely right. This one was hard and it took me quite a while to get back into the exercise game. The windowing java thing was not the right fit for cpp pointers.
I scraped everything and created a completely new exercise, it is more limited in range and probably more direct to help students understand the concepts.

@ahans
You are very welcome to comment 🙌

@vaeng
Copy link
Contributor Author

vaeng commented Oct 2, 2024

I added a task, so students can use the & opertor.

@vaeng
Copy link
Contributor Author

vaeng commented Nov 7, 2024

Hey @ErikSchierboom, do you have time to review this new exercise? I would like to move the syllabus along, but the other two maintainers seem busy.

Copy link
Member

@iHiD iHiD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waved through blindly.

@vaeng vaeng merged commit 3e675fe into main Nov 19, 2024
9 checks passed
@vaeng vaeng deleted the feat--add-exercise-for-pointer-concept branch November 19, 2024 08:56
vaeng added a commit that referenced this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

x:action/proofread Proofread text x:module/concept-exercise Work on Concept Exercises x:rep/large Large amount of reputation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants