Many of these concerns seem to not be limited to Javascript at all - especially once you're sending/receiving data between systems. In Python for example, when receiving JSON/XML payloads you have the same defensive parsing layer at the point of entry, but humans can still mess that up and monkey patch a class that breaks assumptions elsewhere without warning. Did I miss something in the larger argument?
nabla9|7 years ago
Using Javascript as a platform where you mix code generated trough different conventions and tools is a halfway solution. Javascript treated as the unmodifiable binary from the compiler creates same level of trust as using other languages.
Technically:
* In C++ somebody can use different header for the class and break the class abstraction.
* In Haskell some library might go trough the FFI into the runtime and assign values to data in non-functional way and break the functional abstraction.
* In Python and Java there are ways to access data in ways that circumvent the compiler or the language semantics.
The difference is how strong the convention against doing so is and does breaking the abstraction have any benefits.
hoodunit|7 years ago