In C#, if I am returning a Point and cannot find the coordinate what should I return? -


First of all, this is not an exception because it is part of the normal flow of operations. I tried to return a blank object, but it was not allowed. I can return negative coordinates with a point point, but it looks like a hack. For example, if I return (-1, -1) instead of checking for a negative number, maybe some use of my library could directly check the similarity with -1 which will then break if in my internal implementation Change

You return a blank number by changing your return type to point You can. In this way you can also return the null .

Otherwise you can create a static point example anywhere with (& minus; 1, and minus; 1) and always compare it with PointUtils.InvalidPoint probably < Code> px == -1 & amp; Amp; P.y == -1 .


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -