You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, if host =:= undefined, it just encode record with some atom undefined, the encode returns ok, and it's result can not transfer to binary or send with udp port. I think it should return error, or just encode "undefined" to some string but not an atom.
The text was updated successfully, but these errors were encountered:
Well, in that case we need to add checks in many places of encoding functions. I don't think we need this burden really. For example, in the same encode_via we should check Proto, Transport etc have correct values.
I agree with you that it is difficult to check every mistake, but that is codecs should do. Every mistake create by compilers will make bugs far far away and debug is very difficult, I have just spent about 3 hours to catch one, it is dangerous. Maybe it is not the good time to fix it right now, but it should be fixed as soon as possible.
Then you probably chose a wrong language. That's a common problem of duck typing. When you put wrong values to some built-in OTP functions you will get pretty cryptic errors as well. Also, the error you're talking about is not that cryptic, typically you will get badarg which is pretty easy to understand.
Erlang says: crash as soon as possible. I am not choose wrong, and this is not a problem of duck typing. OTP try to throw exceptions everywhere, debug is easy. BTW, is Erlang's type system duck typing? I thought duck typing is something about OO, not functional languages. Maybe I was wrong. This issue is only a suggestion, try to make esip better and easier to use.
For example, if host =:= undefined, it just encode record with some atom undefined, the encode returns ok, and it's result can not transfer to binary or send with udp port. I think it should return error, or just encode "undefined" to some string but not an atom.
The text was updated successfully, but these errors were encountered: