top | item 18315527

(no title)

maglite77 | 7 years ago

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?

discuss

order

nabla9|7 years ago

The larger argument is that you can't have the "language level trust" until you push __everything__ trough the same comppiler/transpiler/validation pipeline and can trust that everything has gone trough it and it has not been modified by other means.

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

No, that is exactly correct. The brunt of the argument applies to most popular languages- Java, Python, Ruby, and what have you- although the specifics vary.