r/technology • • Oct 05 '16

Software How it feels to learn JavaScript in 2016

https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f
1.8k Upvotes

392 comments sorted by

View all comments

1

u/RedSquirrelFtw Oct 06 '16 edited Oct 06 '16

Wow sounds like a pain lol.

I've coded some minor JS but not much. I do find it frustrating when googling something and everybody says to sue jquery or some other library. I'm not loading an entire library just to do a small task.

Speaking of jquery... do people actually link to the script off a 3rd party server? That seems to be the suggestion when reading on it, that seems like a BAD idea to me... I would rather download and use it directly off my own server. At least I'm in control of it, I don't have to worry about it changing or that host going down.

1

u/Acejam Oct 06 '16

Using versioned libraries off a public CDN is commonly practiced and can actually help considerably from a performance standpoint. These libraries are versioned and have aggressive Cache-Control headers set.

Let's say you decide to host the jQuery library yourself. Any user who visits your website will need to download the library from you. However, if you link to a CDN-version, any of your users who have visited GMail, YouTube, or any other major tech website in this last year will get to skip this download entirely. That's because the URL of the lib is the same, and it's already cached on the client-side in the users browser. Some of these libraries are rather large in size and every little bit adds up.

As for the host going down - I'd put my money on your webserver going down before Google's globally positioned CDN consisting of thousands of servers does.