Skip to content

Conversation

@andrerfcsantos
Copy link
Member

@andrerfcsantos andrerfcsantos commented Sep 28, 2021

Fixes #1643

@andrerfcsantos andrerfcsantos force-pushed the add-pointer-concept branch 8 times, most recently from 8ade9b0 to 7ebdcee Compare September 30, 2021 21:38
@andrerfcsantos andrerfcsantos marked this pull request as ready for review September 30, 2021 21:40
Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

I'm really impressed with this PR! You did an excellent job. I've left some minor comments.

I don't really know anything about Go, so I'll leave it to others to review the Go parts of the code.

@ErikSchierboom ErikSchierboom requested a review from junedev October 1, 2021 09:01
@iHiD
Copy link
Member

iHiD commented Oct 1, 2021

I've reviewed the introduction.md - It's really great 🙂

@andrerfcsantos
Copy link
Member Author

Thanks @iHiD and @ErikSchierboom for the extensive review!

These are great suggestions, really appreciate it. At a quick glance, I agree with all of them. I'll go through them in detail and submit a new patch.

@iHiD
Copy link
Member

iHiD commented Oct 1, 2021

@andrerfcsantos I don't think I've ever seen Erik as impressed with a first-pass of a totally new exercise before 👏

@andrerfcsantos andrerfcsantos force-pushed the add-pointer-concept branch 2 times, most recently from f178f6d to e28a6a0 Compare October 1, 2021 13:32
@andrerfcsantos
Copy link
Member Author

Changes applied. Ready for further review!

@iHiD
Copy link
Member

iHiD commented Oct 1, 2021

Great! I probably won't have time to review again before GoBridge launches, so if you're happy with the changes you've applied, I am too :)

I guess we just need a review on the Go side of things and then we can merge :)

@ErikSchierboom
Copy link
Member

@iHiD Yep! Let's wait for a proper Go review, but I'll give it my approval to show the other reviewers I like this PR!

@bobahop
Copy link
Member

bobahop commented Oct 1, 2021

Great work!

A couple of things.

For pointer to a slice, if the slice is appended to in a function it was passed into, the change will not be seen in the original, since the length and maybe capacity will change, but the pointer is only for the address. So in that way a slice does not behave the same as a map. I only mention because they are grouped together in the explanation, and it mentions that map changes will be seen in the original.

The other issue is maybe to caveat against something like

*p = &a

I want to say I read somewhere that it's a common mistake for newer programmers to use the dereference operator when reassigning a pointer to a new address.

Copy link
Member

@junedev junedev left a comment

Choose a reason for hiding this comment

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

Great work! Really well done! 👏
Left some minor suggestions, if you like them they probably need to be applied in all the places.

@junedev junedev added status/awaiting-contributor This pull request is waiting on the contributor. x:size/large Large amount of work labels Oct 1, 2021
Co-authored-by: Jeremy Walker <[email protected]>
Co-authored-by: Erik Schierboom <[email protected]>
Co-authored-by: June <[email protected]>
@andrerfcsantos
Copy link
Member Author

Made the suggested changes.

In addition I also made other improvements:

  • In the pointer arithmetic example I declared the variables using the long form instead of the shorthand syntax. This is to 1) make the types of each variable more explicit 2) be more consistent with the rest of the examples
  • I modified the map example slightly to increment a value on an existing map instead of adding a new key. This is just to be closer to what the student will be required to do in the exercise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/awaiting-contributor This pull request is waiting on the contributor. x:size/large Large amount of work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sept Sprint] New exercise teaching pointers

7 participants