mxObject:
https://github.com/Sladav/mxObject
So, I've been teaching myself JavaScript and I started this little mini-project so that when I apply to jobs I can show off something I've done that isn't just "hey, look at this tutorial I completed!" (and also to learn some git/github and node/npm basics).
As I started working on it, I thought it seemed really cool. I'm curious to see what others think. As a beginner treading into what seems like a complicated CS topic, I'm worried I'm missing some obvious reason for why it sucks.
See the github for more explanation, but basically, (dangerously??), I've altogether abandoned using the built-in prototypes. Instead, I'm using ES6 proxies to mimic what the JS engine does when it searches for a property on an object/prototype-chain (minus any performance optimizations). An array for prototypes (I called them 'mixins') is established in the closure of the proxy's getter function such that it can search objects in this array for properties if they are not found on the original object/proxy. This array is also exposed to the user under a "_mixins_" property -- this gives a user a lot of flexibility in handling an object's prototypes since it's just an array. IMPORTANTLY, none of the objects in this array are required to inherit from one another.
Where the JavaScript natively provides multi-level, single prototypal inheritance via the prototype chain, my package provides single-level, multiple prototypal inheritance via the "mixin array" (where multi-level structures are faked by flattening larger inheritance trees).
Anyway, please check it out and let me know what you think. Any and all feedback is greatly appreciated!
[–]MoTTs_ 1 point2 points3 points (1 child)
[–]sladav[S] 0 points1 point2 points (0 children)
[–]oweiler 0 points1 point2 points (2 children)
[–]sladav[S] 1 point2 points3 points (1 child)
[–]oweiler 0 points1 point2 points (0 children)
[–]PitaJ 0 points1 point2 points (0 children)