2 ms·
Firstly, it’s functional with closures… From there prototypal - so you can express whatever you want… the key is being functional. This was a key to the advent
by h335ian 2y ago
Firstly, it’s functional with closures… From there prototypal - so you can express whatever you want… the key is being functional. This was a key to the advent of JSON, but is also one of the most elegant and powerful bits of JS
- trashburger 2y agoYou're wrong. The prototypical model of JS was inspired by the Self programming language[0], itself a descendant of Smalltalk. It is a very crude implementation for sure, but it is object programming nevertheless. Closures being present sours the purity a bit, but closures are poor man's objects[1] anyway. [0]: https://selflanguage.org/ https://selflanguage.org/ [1]: https://stackoverflow.com/a/11421598 https://stackoverflow.com/a/11421598
- thesecretsquad 2y agoAlso, Smalltalk was heavily inspired by LISP[0]. The line between functional and object-oriented is quite blurry. Especially in a pure OO language like Smalltalk. The dynamic and prototypical model of JS is definitely another example of the subtle harmony of functional and OO. [0]: https://worrydream.com/EarlyHistoryOfSmalltalk/ https://worrydream.com/EarlyHistoryOfSmalltalk/
- trashburger 2y agoI agree 100%. I firmly hold the belief that the two paradigms are just different perspectives of looking at the same thing (state and behavior). Also see https://insearchofsecrets.com/2014/08/04/lisp-smalltalk-and-the-power-of-symmetry/ https://insearchofsecrets.com/2014/08/04/lisp-smalltalk-and-...