On Mon, Jun 16, 2008 at 2:02 PM, Stanislav Malyshev <[EMAIL PROTECTED]> wrote:
> Hi! > So you just ignored the "special cases" part. Yes, if you have special > case where you interface with very brain-dead strictly typed system that > absolutely can't understand that '1' and 1 is the same - then you need to > _convert_. So how failing when you get '1' instead of 1 helps you? You'd > need _conversion_, not _failure_ - and if you write strictly-typed API, > you'd move the conversion responsibility to the user, instead of having it > where it belongs - in the API. That's *exactly* why I see strict typing in > PHP so dangerous - it promotes lazyness and sloppiness in API writing, and > those APIs will be a nightmare to use, since they would bomb out on > slightest disagreement about internal engine types, which the API user > shouldn't care about at all. What happened with "be liberal at what you > accept"? > In strict compiled languages, the compiler and IDE will guide you > through this, in PHP you'd just have it explode in your face in production. > How this is good for anybody? I get this, really, I do, again. Like the previous post I (likely we) understand. Did you not get or read my post? You say again and again 1 == '1', but you are forgetting those OTHER operators, === and !==. 1 !== '1' does it? ====>Add numeric hinting like I said 50 posts ago and your 1 == '1' problem is solved<==== People who want to make more simple API's will make simple API's offsetting the complexity of your precious 1 '1' to the API level. People who want to make it strictly integer, will continue to do so as they do now. You can not, and should not want to, control the way people program. But I know this will never happen because no one cares what users want... your logic of "We should allow user to check for is_int and is_numeric, resource, object, array, string, etc, within any conditional statement under a function or method. Allow checking for object or array in functions or methods paramters. Disallow anything else from being checked in functions or methods paramters. Follow a philosophy that a user should not be concerned with internal data types. Make sure the user has access to internal data types. User should not have to talk to strict typed systems. But if they do have to make it more difficult then it needs to be because it makes more sense, plus those systems are brain dead." How in the world, does this remotely, possibly, even slightly make sense? -Chris