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

Using of struct in vector. #1777

Closed
wants to merge 4 commits into from
Closed

Conversation

mani-chand
Copy link
Contributor

@mani-chand mani-chand commented Feb 2, 2024

Storing structs in a vector allows you to manage a collection of structured data dynamically, and it's a flexible way to work with multiple instances of the same type.

For Example :

Every website as users and user has data like email, name, password . for storing user data we need struct (In which we can store different type of data) and vector is used to store multiple values of same type of data.
By using both vector and struct we can any number of user's data in a structured way.

Storing structs in a vector allows you to manage a collection of structured data dynamically, and it's a flexible way to work with multiple instances of the same type.
@AArnott
Copy link
Contributor

AArnott commented Feb 3, 2024

I don't know why you're asking me to review this. I don't have Push permissions on this repo.

@mani-chand
Copy link
Contributor Author

I don't know why you're asking me to review this. I don't have Push permissions on this repo.

I am sorry about that . Its my bad that I thought you are reviewer.

@djmitche djmitche self-requested a review February 3, 2024 20:00
@djmitche
Copy link
Collaborator

djmitche commented Feb 3, 2024

Apologies to those who were pinged (it appears the pinging comment has been deleted).

@mani-chand please email me (my username at google.com) to discuss.

@mani-chand
Copy link
Contributor Author

mani-chand commented Feb 3, 2024

Hello @djmitche ,I am sorry for tagging wrong users. I have mailed you.Let me know about changes in PR. I thing it is good to merge.

@mani-chand
Copy link
Contributor Author

Hello @djmitche , Can you please let me known about status of PR.

1 similar comment
@mani-chand
Copy link
Contributor Author

Hello @djmitche , Can you please let me known about status of PR.

Copy link
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

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

I don't know of cases where students were confused about what sort of values can be put into a Vec. Most students come to this course from C/C++, Java, Go, or an interpreted language like Python or Ruby -- all of which allow any type of value to be placed in an array/list/vector. Maybe @randomPoison or @marshallpierce can provide their perspective?

This slide is already in our "preferred" format, which is to say it's small enough to fit on a single screen (more info in #1464). So, adding another 10 lines to the content is a bit counter-productive. If we do decide to include this content, i think it needs to be done in a way that does not add more lines to the example or remove any of the existing lessons.

@mani-chand
Copy link
Contributor Author

I don't know of cases where students were confused about what sort of values can be put into a Vec. Most students come to this course from C/C++, Java, Go, or an interpreted language like Python or Ruby -- all of which allow any type of value to be placed in an array/list/vector. Maybe @randomPoison or @marshallpierce can provide their perspective?

This slide is already in our "preferred" format, which is to say it's small enough to fit on a single screen (more info in #1464). So, adding another 10 lines to the content is a bit counter-productive. If we do decide to include this content, i think it needs to be done in a way that does not add more lines to the example or remove any of the existing lessons.

Ok , I will check.

@mani-chand
Copy link
Contributor Author

Hello djmitche , Is it ok to add 5 lines in speakers notes. If it is not possible then you can suggest is any other way or, I am happy close my PR because there is no other way.

@marshallpierce
Copy link
Collaborator

I haven't seen any student confusion over this. Since Rust does not have limitations on what the generic type can be (ala Java's generics only applying to reference types, not primitives), I suspect it might cause more confusion than clarity to single out structs for special treatment. Why not enums, or references?

@mani-chand
Copy link
Contributor Author

mani-chand commented Feb 5, 2024

I haven't seen any student confusion over this. Since Rust does not have limitations on what the generic type can be (ala Java's generics only applying to reference types, not primitives), I suspect it might cause more confusion than clarity to single out structs for special treatment. Why not enums, or references?

Hello marshallpierce, Thanks for the clarification . I am happy to close my PR then.
PS : I wanted to add this for syntax purpose.

@mani-chand mani-chand closed this Feb 5, 2024
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

Successfully merging this pull request may close these issues.

4 participants