What do you think of using a longer names for generic type variables? (Expect<SubjectT> instead of Expect<T>) #1700
Answered
by
robstoll
vlsi
asked this question in
Contributor Q&A
-
See https://google.github.io/styleguide/javaguide.html#s5.2.8-type-variable-names WDYT? E.g. infix fun <T, R> Expect<T>.feature(property: KProperty1<in T, R>): FeatureExpect<T, R> =
// =>
infix fun <SubjectT, PropertyT> Expect<SubjectT>.feature(property: KProperty1<in SubjectT, PropertyT>): FeatureExpect<SubjectT, PropertyT> = |
Beta Was this translation helpful? Give feedback.
Answered by
robstoll
Feb 4, 2024
Replies: 1 comment 2 replies
-
the style guide mentions also the short form 😁. just kidding, I am with you, we already use longer names in some cases ( though we use TSubject instead of SubjectT but both fine with me) I don't mind if we are clear in all cases. I'll create an issue once I am in front of a Screen |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So let's do it on a case by case basis. I won't create an issue therefore and instead, contributors can feel free to change the naming in PRs if they should be affected. I think it would make sense to document the type parameters in case of a single T so that it is still clear (sometimes we do it but I think not always)