4 ms·
The js code uses c/c++ paradigms instead of good js i.e. Operator overloading in c-style isn't ideal but functions can accept a single associative array to acco
by thegoleffect 17y ago
The js code uses c/c++ paradigms instead of good js i.e. Operator overloading in c-style isn't ideal but functions can accept a single associative array to accomplish the intended functionality. Interesting goals of getting symbolic math in js though /applaud.
- btilly 17y agoCould you please clarify with a short example of the style you'd recommend? As a non-JavaScript programmer tackling a problem of a kind I haven't dealt with before I'm sure there are glaring deficiencies in the approach I took. However I'm not quite sure what specifically you'd recommend that I'd do differently. Also note that some of the overloading stuff you are looking at is there because my next step is to start doing linear algebra and multi-variable calculus. So I'll be throwing around things that I can't simply use + and * with.
- thegoleffect 17y agoOh, sorry, I don't check replies very often. It is much better to email me. But yeah, I could tell right away what language(s) you are coming from ^_^. For readability, I usually take a single JSON parameter (which you can access the same way you already do w/ arguments obj). This works especially works well if you have inputs that require default assignments (b/c that assignment code can be cut down to ~4 lines). I'm not looking that thoroughly through the code, but if you are making objects with shared methods, you might want to try defining some obj methods with your_object.prototype.function_name. Toss me an email if you need/want more info ;-).