Today in #learnToLoveJS, I explore getting data from PHP into JS, how objects don’t make a good substitute for arrays, and why I still hate “this” and scoping. https://rosswintle.uk/2018/06/more-struggling-with-js-how-the-php-js-interface-is-broken-and-why-this-is-painful/
In my “Spare” time today I tried to #learnToLoveJS by writing some Vue and Axios It was a pretty spectacular failure. JS seems to just want to trip me up at every step. The APIs for arrays and objects are inconsistent. this is different with arrow functions. Just….ARGH!!!!
OK, so, this seems to be the thing. If you’re using Vue components, go all-in. Mixing reactive JS frameworks with standard page-reloading back-ends doesn’t work well. I’m not sure I like that. I’d like adopting JS frameworks to be more incremental. But hey. #learnToLoveJS
It probably won’t happen soon, but I should document what my issues are with JS. Some of it is ingrained behaviour & old ways of doing things that I need to shake off. But I also think JS is pretty lacking in some areas. Perhaps those opinions also need to change? #learnToLoveJS
And yes, I’m aware that “speed” of a language isn’t a huge factor. Writing efficient code has a far bigger effect. So I gues the question really is: does the language help you write efficient code? #learnToLoveJS
What I couldn’t find was details of when bytecode compilation is done & if a Node or browser process keeps any kind of cached compiled code (bytecode or object code) for future execution/requests. My guess is that Node, at least, would do this. References anyone?! #learnToLoveJS
In my quest to #learnToLoveJS today I looked into the basics of V8 architecture to see just how JS becomes object code. I’m relatively convinced of its speed. It’s hard to know exactly how good and efficient garbage collection is, but the marketing is good! 😉👏
Here’s some stuff copied over from Twitter in which I try to #learnToLoveJS …