this seems like a weird evolution, can someone exp...
# language-evolution
s
this seems like a weird evolution, can someone explain it? worst API idea ever. keep in mind its also "// Unresolved", whatever that means
👎 1
its not marked for removal, so people are expected to copy it to a custom util method?
j
Does this answer your question? https://stackoverflow.com/a/67845025/1540818
s
no. I don't get it.
they did something cool and then it was deprecated for no-reason, because what if you use some weird chars? 😕
I don't use those chars
👎 1
its not even about chars, but about replacement
instead of single method, use .... whatever the replacement is
j
It wasn't deprecated for no reason. Look at the comments section under my answer. You found the original function cool, but a lot of people were confused. Not everyone has the same idea about what a function with this name should do, so it was decided to deprecate it until the user needs were more clear.
s
I can make my own extension method and call commons lang3, why replace it with a monster?
it would be easier to understand with a for loop and look worst
maybe its a cool idea for improvment. I don't get the replacement, its just complex for no reason
j
Regarding the replacement, you actually probably shouldn't use it as-is. This is to allow users to migrate to the exact same behavior via automated quick fix. You might decide that you don't actually need the weird original behavior, and instead use a simpler replacement.
For instance, do you find
replaceFirstChar(Char::lowercase)
that terrible? You can of course define your own
decapitalize
function with this body, if you find this name clearer.