G
Gordon Cowie
In general I agree with you about using "magic return values" to
I'm going to go out on a limb and postulate that any design involving
returning a special code that is the same datatype as the normal result
to not be the best design.
It's the oldest design. Maybe the simplest. Definitely the widest in use.
C# is full of great design philosophies that we conform to in the
journey to write better code. I really don't have a huge problem with
the way IndexOf works (I hardly use it), just using it to spur
discussion as I thought there would be interest from some "code purist"
C# lovers here.
indicate special situations. However, in this case I think it's the
best design out of the available alternatives.
I'm going to go out on a limb and postulate that any design involving
returning a special code that is the same datatype as the normal result
to not be the best design.
It's the oldest design. Maybe the simplest. Definitely the widest in use.
C# is full of great design philosophies that we conform to in the
journey to write better code. I really don't have a huge problem with
the way IndexOf works (I hardly use it), just using it to spur
discussion as I thought there would be interest from some "code purist"
C# lovers here.