Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

@ars, you completely missed my point. Lets go over it again. Tell me how should the following things convert:

     77
     077
     77.0


I GOT your point. I don't care about your point because it is not the question I am asking.

Why are you answering something I did not ask?

I am asking why does Danack prefer strict mode. There is absolutely nothing in my question that cares about the specific details how you convert bits to types, other than that you do.

My question is entirely about WHO does the conversion. NOT about the conversion itself.

(Oh, and the thing about bad-data has a defined meaning that went over your head because you are not familiar with the debate here. In this context bad-data means data loss on conversion. So "1" to 1 is fine, but "1 a" to 1 is not.)


The conversion itself is very relevant because you cannot establish a default conversion that should happen, therefore the conversions should be explicit, answering the WHO. This is why I asked you about what should the conversion produce in those examples.

And also in the conversion from "1.1" to 1.1 there is loss of information, because the two representations are not isomorphic. Care to guess why?


This is the point that ars is making. He is saying that it has to be a runtime check and/or conversion because it is coming over the wire, as a string, at runtime.

So the question he is asking is, if you have to do the check at runtime anyway, what is the benefit of the type hinting? Isn't it just belt and braces?

It seems like a perfectly legitimate question to me.

And by the way, to those downvoters who don't seem to be able to tell the difference between a comment you disagree with and spam, can you please contribute to the conversation by hitting the reply button or alternatively get lost? Only you're ruining it for the rest of us. Thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: