Why pointer vs. value in the generated code? #43
-
The documentation talks about preferring pointers vs. values in model slices, but doesn’t explain why. Any particular reason for this choice? https://bob.stephenafamo.com/docs/code-generation/usage
|
Beta Was this translation helpful? Give feedback.
Answered by
stephenafamo
Apr 1, 2023
Replies: 1 comment 2 replies
-
Actually, I should change the comment to be The recommendation is not about pointers vs values, but more about using the defined type |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
stephenafamo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, I should change the comment to be
instead of []*Jet
The recommendation is not about pointers vs values, but more about using the defined type
JetSlice
over[]*Jet
. The reason is that there are some convenient methods defined onJetSlice
that would not be available when using the plain slice.