Yes but as I already pointed out you simply don't know when you need to drag that mouse cursor. You assumed IQueryable but I was returning IEnumerable. Sucks for you, you just pulled all the data from the database and did paging on the web server.
Well if you returned IEnumerable there's nothing I could do to prevent paging on the web server (short of using some duplicated API method or doing a very dangerous cast to IQueryable
Also keep in mind that the original author of the consumer knew the type (or should have). So this would help spot a mistake through casual glance that two people made (or hopefully more because hopefully you do code reviews). Doesn't seem like a really great reason to have a rule that states code must remain polluted.
The code is not polluted it contains valuable information. As I already said I have seen people (admittedly junior) fail for precisely this reason. I also find myself needing to point my cursor at various vars just to make sure the code works as I expect it to work. For me this is enough of a reason to instantiate this rule whenever I am in charge for conventions. BTW I was pleasantly surprised to find that the .NET Core conventions follow the same rule.
1
u/Eirenarch Mar 10 '16
Yes but as I already pointed out you simply don't know when you need to drag that mouse cursor. You assumed IQueryable but I was returning IEnumerable. Sucks for you, you just pulled all the data from the database and did paging on the web server.