Hello, World! I want to enhance the `toString` of ...
# announcements
b
Hello, World! I want to enhance the
toString
of some class that belongs to a dependency. For that I'll make an extension, but can't call it
toString
for obvious reasons, and I'm not very inspired, can you think of a good name?
betterToString()
/
toExtraNiceString
/
toEnhancedString
/
toDetailedString
... Better ideas? 🙏
m
How is the
toString
better? Maybe
toDebugString
to convey that it contains more information suitable for debugging?
👍 2
n
toUnderstandableText()
?
b
I like
toDebugString
!
r
If it's for display purposes, I often use
prettyPrint()
, though it's not really the most descriptive.
a
you could use an overloaded
toString()
if your function takes arguments. Otherwise I would stick to the something like
X.toSttoingExt()