To smurf or not to smurf? That is the question #2131
Replies: 7 comments 19 replies
-
smurf ftw |
Beta Was this translation helpful? Give feedback.
-
Smurf all or smurf none (as you noted). I'm fine with smurfing to avoid name collisions and provide better autocomplete. |
Beta Was this translation helpful? Give feedback.
-
I think smurfing is appropriate, especially since it's only 4 letters more. Better autocompletion, no name collisions... as long as we don´t name functions like TypedRemoteProcedureCallContextCreator. |
Beta Was this translation helpful? Give feedback.
-
All good for smurfing. |
Beta Was this translation helpful? Give feedback.
-
Gonna play the devil's advocate: Don't smurf. And secondarily because it's just tedious to write; brevity ftw. |
Beta Was this translation helpful? Give feedback.
-
Would this mean Smurfing improves readability of the code even though it's uglier. I think it's a mistake to optimize for aesthetics over readability. Plus, when you have a name space you get some really cool auto complete/auto import functionality. IE you can type "TRPC" and just arrow key through all its exported members. Not sure that's particularly useful here, but just an example of why it might be advantageous. |
Beta Was this translation helpful? Give feedback.
-
@dodas brought up a good question today which lead me to think about our exposed interfaces, should those all contain
TRPC
in the naming somehow?I'm personally a bit annoyed whenever I use a "generic" name like
createClient
orcreateContext
within VSCode, I often don't get the suggestion I want.Should tRPC be exposing smurfed interfaces or non-smurfed functions? It would be good to get consistency in this for V10.
Examples:
initTRPC
vsinit
setupNext
vssetupTRPCNext
setupReact
vssetupTRPCReact
Beta Was this translation helpful? Give feedback.
All reactions