úterý 6. března 2012

blah.blih(bla,bla,bla).Whatever.Substring(0,6) kabooom

Yes you are right, this is yet another of the "someone's stupid" posts. Is there anyone, anyone at all, who thinks it's a good idea to throw an ArgumentOutOfRangeException("Index and length must refer to a location within the string.") if the second parameter to Substring() is too big? For gawds sake when was there a time you cared? I want the bloody result to be at most 6 fscking characters! I don't give a flying fsck if it's four already! No body gives a flying fuck! It might make sense to throw when the index points outside the string even though a more sensible approach would be to stay calm and return an empty string, but throwing just because there's not enough silly characters is simply ... microsoftish.