I have a function that converts an object into nullable int:
public int? ToInt(object x) { ... }
Now I need another function that would return 0 instead of null if conversion is not possible:
public int ToIntSomeOtherName(object x) { ... }
What would be a good name for that other function ?
I know this seems trivial, but I’ll be using these functions in many places and
a good naming convention would be a big plus.
I think
ToIntis better for your second method:And you can rename the first one: