Hacker News new | ask | show | jobs
by djhworld 2978 days ago
One thing I've taken away from this is vanilla Javascript seems to have come a long way, or I've just never taken the time to fully appreciate all the features

For example I didn't even realise JS supported string interpolation

https://github.com/toddwschneider/stocks/blob/master/index.h...

5 comments

There's some really good examples of this in Wes Bos' (free) javascript30.com course - 30 short videos all using vanilla Javascript and showing some really neat new features.

Another really awesome new feature which I can't remember if it's in that course or not, is fetch - super simple AJAX API using promises. It's also used in this app: https://github.com/toddwschneider/stocks/blob/master/index.h...

I didn't know about fetch, that's pretty neat. Unfortunately for me, it isn't supported on IE: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
Fortunately, there is a very good polyfill[0] for it.

[0]: https://github.com/github/fetch

I had taken a nearly six year break from JavaScript coding until about 7 months ago. It has definitely come a long way and is pretty great to use now.

There’s still a lot of “pain” left in the build processes, transpiling, etc, but they’re less painful than they were half a decade ago. Those are also less specific to issues with the language, and more with how we need to use the language.

While not plain JS, I’d strongly recommend trying Vue if you’re getting back into JS. Is a true pleasure to use on a daily basis, and I never find myself fighting it. It makes writing non static sites with interactivity a breeze, and even when I’m building near static pages, I like how it helps me to organize my code (from a structure standpoint, it isn’t opinionated on this stuff).

I recently stumbled upon the Airbnb Javascript Style Guide, which I found showed a lot of good examples of how to use newer Javascript features: https://github.com/airbnb/javascript
After several years of stagnation, ES6[1] massively improved the language, and there is a pipeline of more proposals[2].

[1]: http://es6-features.org/

[2]: https://github.com/tc39/proposals

... and I didn't realize that one could link to a specific line in code on a github file like you've done...

    index.html#L111
in

  https://github.com/toddwschneider/stocks/blob/master/index.html#L111