Automatic type casting remains popular because it reduces the syntactic and cognitive overhead. I'm suggesting that a better solution would be to retain explicit casting, but minimise the overheads.
So, to take things a step further, lets use, say, the $ operator for casting. Then we have:
The proper way to do this is using something like TryParse() and ToString() and to handle the case of failing to parse the string as a number and maybe even specifying the locale for both operations. If you are absolutely sure that parsing can not fail you can use Parse() and omit the error handling.
So, to take things a step further, lets use, say, the $ operator for casting. Then we have:
What do you think?