6 ms·
Funny. JS is my main language, and I personally also don't know most of the intricacies of JS, and we seem to share the same mindset. I mean, I do know common
by Secretmapper 10y ago
Funny. JS is my main language, and I personally also don't know most of the intricacies of JS, and we seem to share the same mindset.
I mean, I do know common pitfalls and I can use `this`, etc., it's just that I find it's easier to avoid them entirely and leads to more readable code IMHO. In a way my JS tends to just be very scheme-like.
- dang 10y ago> In a way my JS tends to just be very scheme-like Mine too! I've felt for many years that we were lucky that Eich happened to have read SICP not long before those fateful two weeks in 1995. For all that we all love to hate JS, the language of the web could have—and to judge by all historical precedents, should have—been much worse.
- trgn 10y agoI find JS works well as an OO-language, and falls short as a functional one. Not only when writing it, but also when it's executing. Dumb-as-rocks object oriented JS-code tends to have a smaller memory footprint, is less crufty, and is easier to debug. Functional JS-code tends to spam the heap, difficult for the JIT to optimize, and when writing it you have none of the compile-time safety of a true functional language. Crockford succeeded in popularizing JS, partly by stressing the Scheme-like features of the language, but I'm not convinced that's where the strengths of the language lay.
- spraak 10y agoThis is surprising.. do you have any examples of memory footprint, crufty-ness, and debug-ability for OO vs functional style JS?
- Secretmapper 10y agoThis may indeed be true, but I've found the performance penalty to be acceptable for my use cases. There ARE times where I had to optimize though (HTML5 game developer, and we target mobile so this is expected) but for the most part 'premature optimization is the root evil'.