> Not every object in JS is intended to travel between client and server, or to 
> be stored in JSON. And if/when the class want to share some information, it 
> can easily translate its data to and from a JSON-friendly format.

hi Claude, agree to disagree.  its impossible to predict/design what should and 
shouldn’t travel between client <-> server in javascript product-development.  

the best you can do as an “architect” is to accept that *anything* 
of-consequence in javascript will eventually need to "leak" itself to the 
"client <-> server <-> db JSON/urlstring dance", over the normal-flow of 
UX-features getting added to a product;  and that much of the tech-debt in 
these projects arise from needless class constructor/serialization hacks to 
make that dance happen, when it wasn’t expected (and could’ve been avoided by 
sticking with plain JSON data-structures).

even in esoteric, seemingly non-web-related cases like using duktape in c++:  
why would anyone want to have embedded js-capability in such scenario?  the 
only use-case that comes to mind is for manipulating JSON data-structures, and 
again, passing plain JSON-data between "c++ program" <-> “external web-system"

kai zhu
kaizhu...@gmail.com


> On 11 Oct 2018, at 5:14 AM, Claude Pache <claude.pa...@gmail.com> wrote:
> 
> 
> 
>> Le 10 oct. 2018 à 23:17, kai zhu <kaizhu...@gmail.com> a écrit :
>> 
>> hi Man, i don’t have strong opinion on Array.prototype.remove, but i have 
>> strong opinion against your use-case to subclass/extend Array.  from a 
>> product-development perspective, you're creating unnecessary 
>> integration-headaches by having the client <-> server system pass around 
>> <MyArray> instances instead of plain JSON arrays.
> 
> Not every object in JS is intended to travel between client and server, or to 
> be stored in JSON. And if/when the class want to share some information, it 
> can easily translate its data to and from a JSON-friendly format. (Sorry, I’m 
> not motivated to read the rest of your e-mail.)
> 
> —Claude 
> 

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to