Re:Strong Types and Their Impact on Testing
by xwowsersx on Tuesday November 18, 2014 @01:37PM
(#8625440)
And then if you're missing a key in your object, your program blows up at runtime.
Re:Strong Types and Their Impact on Testing
by serve_yay on Tuesday November 18, 2014 @02:35PM
(#8625825)
In JS, true. You can't do any of this stuff in JS! :)
But I guess my real point was that that seemed like more of an argument against positional parameters than for lots of typing. I like how ObjC handles this, I wish more languages did it that way.
I would just solve that with keyword arguments. Or, in Javascript, have the constructor take an object whose keys are fromAddress, toAddress, etc. (Pretty much the JS/ES5 version of keyword args.)