This is the least stressful poll you'll hear about all day: which naming convention do you prefer for a `TypeClass[Foo]` instance in Scala?
-
-
Replying to @travisbrown
typeClass is not always possible, if you go through traits - I sometimes extends TC1Instances with TC2Instances -> conflict.
1 reply 0 retweets 1 like -
Replying to @NicolasRinaudo
Yeah, I think it's the only bad choice in the list, but you do see it fairly often.
1 reply 0 retweets 0 likes -
Replying to @travisbrown
the first two depend on the case for me - I'd write stringCodec, but genString, for example. No idea why.
1 reply 0 retweets 1 like -
Replying to @NicolasRinaudo
Same here—in some cases one seems right and in some cases the other, and I'm not sure I can describe the difference clearly.
1 reply 0 retweets 1 like -
Replying to @travisbrown
verb vs noun? gen is generate, you generate a string. Codec is a thing - a string codec, or a codec of string.
1 reply 0 retweets 1 like -
Replying to @NicolasRinaudo @travisbrown
Generally undecided; I sometimes use `implicitFooTypeclass`. Long names encourage only *deliberate* shadowing.
1 reply 0 retweets 1 like -
Replying to @propensive @travisbrown
that seems like overkill though... `publicImplicitValFooTypeclass`? :)
2 replies 0 retweets 0 likes -
Replying to @NicolasRinaudo @travisbrown
It's a horrible way to work around accidental shadowing, but it's the best I've got.
2 replies 0 retweets 0 likes -
Replying to @propensive @NicolasRinaudo
I can do better: implicit val `this TypeClass instance for Foo really, really doesn't want to get shadowed` = …
2 replies 0 retweets 0 likes
Also works. ;)
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.